Comments (8)
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.
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.
@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.
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.
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.
@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.
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.
from hledger-flow.
Related Issues (20)
- File-specific rules HOT 5
- hledger-flow does not 'see' _manual_ year subdirectory if there is no corresponding 1-in subdirectory HOT 1
- QUESTION: how to break up a transaction/payment? HOT 12
- If I delete a file in a `1-in` directory, re-running `hledger-flow import` does not remove the corresponding files in the `2-preprocessed` and `3-journal` directories HOT 4
- Missing version bound on turtle breaks build HOT 3
- Have a way to use `--cost` option for income-expense reports HOT 1
- `hledger-flow` reports empty for user sub-accounts (due to missing `directives.journal` at lower levels) HOT 3
- (docs) unclear what to do if starting balance is not 0 HOT 6
- Where to put account declarations and prices? HOT 1
- Support for Apple Silicon (aarch64-darwin) HOT 3
- hackage doesn't have the 0.15 release
- Windows: the preprocess and construct scripts are not executed HOT 1
- QUESTION: tags, reports, multiple contributors, virtual accounts, how to do it simply? HOT 2
- when preprocess is called with a $1 that has a .timeclock extension, $2 has a .csv extension HOT 3
- 3-journal/ files not ending in ".journal" extension are added to yearly include files HOT 6
- Make it possible to configure the number of cores being used (the default is to use all cores, which slows down the machine) HOT 18
- hledger-flow does not 'see' hledger despite it being present in the PATH as a symlinked executable HOT 3
- cabal install error: Not in scope: type constructor 'Rel' HOT 2
- Question: where to include "meta" statements (`account...`, `commodity format` & `alias`) & prices? HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hledger-flow.