Code Monkey home page Code Monkey logo

Comments (8)

TC72 avatar TC72 commented on September 14, 2024 2

OK, I've got what I needed by actually reading the Full-fledged Hledger.
When I read the documentation in my head "Full-fledged Hledger" was just referring to running Hledger manually.

After reading it I see that I really should be adding rules at the level of matching a single transaction and use the table format for rules to keep this manageable:

if|account2|comment
...
2017-10-11.*EMPLOYER INC||per diem for the trip to New York

I was also worried about my rules files becoming huge an unmanageable, but this kind of single transaction rule only needs to run for a specific account.

from hledger-flow.

japhir avatar japhir commented on September 14, 2024 1

I just added this nice dateutils package with the following example preprocess script:

#!/usr/bin/bash

cat $1 | dateconv -S -i "%d-%m-%Y" -f "%F" > $2

This was particularly useful for some pesky files where they had 3/5/2023 as a date, and I didn't want to think about adding those leading zeros back in for ISO date formatting.

<3

from hledger-flow.

jfly avatar jfly commented on September 14, 2024

@TC72, I personally make sure there's a rule for everything. That can get a bit awkward, but I like that there's nothing precious about my 2-processed and 3-journal directories, I can always recreate them from my csv and rule files.

I have no idea if this is a good long term plan (for example, it means my rules files are going to grow without bound). I'd be quite curious to hear how other people handle this.

from hledger-flow.

TC72 avatar TC72 commented on September 14, 2024

Thanks for the reply.

There are some things I can't do with rules.
For example if I go on holiday I tag every transaction related to it with holiday:summer-2023.
That way I can tag flights, car rental, restaurants and have a total cost for the holiday.

But I go to the same places in different years and a rules file can't handle this without me adding rules to match the exact date and month of each transaction which is a mess.

For this kind of thing manually editing the report is much simpler and it's how hledger was designed to work with the .latest files and only appending to existing reports. To lose manual edits you have to go out of your way to delete both the .latest file and the journal file.

I know I can make this work, even if it involves some git magic to deal with it. Just figuring it out and seeing if I'm missing the right way to do it.

from hledger-flow.

japhir avatar japhir commented on September 14, 2024

One thing that kept confusing me about this though, is that every time I had to enter a specific rule like this I had to look up how that particular CSV file was formatted. I can't just match against the YYYY-MM-DD format because some banks have very different date formats, or put the payee before/after the description etc. This made me have to open the raw CSV, double check the entry, then write the regex to match that line. Am I missing something here?

from hledger-flow.

jfly avatar jfly commented on September 14, 2024

@japhir, I found that quite frustrating as well. I eventually got fed up and opted to write preprocess scripts for each of my financial institutions to coerce them all to the same ISO date format.

from hledger-flow.

japhir avatar japhir commented on September 14, 2024

Ah yeah sounds like a nice solution. Only downside I can think of is the extra stupid work + the fact that you can no longer share your bank parsing .rules files easily with others who may want to use them (I was thinking about committing all my new banks parsing rules files to https://github.com/simonmichael/hledger/tree/master/examples/csv soon)

from hledger-flow.

simonmichael avatar simonmichael commented on September 14, 2024

from hledger-flow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.