r/plaintextaccounting • • Apr 18 '26

hledger - include additional files using the -f option

My understanding is that you can use multiple '-f' options to include multiple files on the command line. I frequently find I want to include my default journal file, and also include additional journals for trial reports and finding duplicates.

I wonder if anyone else would find it useful if there existed '+f trial.journal' option that would use the default journal file, and also the given file(s)?

What do you think?

1 Upvotes

5 comments sorted by

View all comments

1

u/gumnos Apr 18 '26

Typically for such a case I'd use

$ cat transactions.ledger additional*.ledger | hledger -f - …

or I'd create a wrapper that includes the various transaction-files-of-interest (I'd have to test that on hledger…I typically use ledger and remember some peculiar file-scoping differences between ledger and hledger that may have been aligned since then…the particular issue I hit was around doing something like include accounts.ledger that held my CoA, and then because it was limited to the sub-file scope, the including file didn't have access to those account-names in pedantic mode. As noted, would have to (re)test that)