Multiple journal files?

437 views
Skip to first unread message

Rick Mann

unread,
Mar 6, 2018, 2:59:36 AM3/6/18
to Ledger
I'd like to use Ledger to keep track of both my personal and LLC finances. But I'm frequently moving money between them (usually personal into the LLC), and I'm weighing the pros and cons of keeping them all in one journal, so that I don't have to duplicate the transactions between them.

Ideally, I could do this with two journal files, one for personal and one for the LLC, and have it read in both files each time I run ledger. But I don't seem to be able to specify multiple files.

I'd like to do the same to break up journal files into years or even months, so they don't grow too large.

Is that possible?

Roderick Mann

unread,
Mar 6, 2018, 3:10:10 AM3/6/18
to ledge...@googlegroups.com
Oh! I just tried specifying multiple --file options, and that worked.
> --
>
> ---
> You received this message because you are subscribed to a topic in the Google Groups "Ledger" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/ledger-cli/sQU3kOzKVgM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to ledger-cli+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.


--
Rick Mann
rm...@latencyzero.com


Alexandre Rademaker

unread,
Mar 6, 2018, 4:14:42 AM3/6/18
to ledge...@googlegroups.com

What about one bank account per file? In that case I need a way to avoid duplicate a transaction that envolve two accounts of different files. I remember that in the pass we had a discussion about unique transaction ids in the metadata. Do ledger and hledeger support it?

Alexandre
Sent from my iPhone

Dániel Fancsali

unread,
Mar 6, 2018, 4:21:33 AM3/6/18
to ledge...@googlegroups.com
Hello,

My solution is to have one file per bank account, and the transfers are marked with an UUID tag, so they will only be considered by ledger, when seen for the first time.

Also, when including multiple files, you have to be very careful with the balance assertions, as balance is calculated in parsing order, and not by ordering all the transactions in memory. My solution for this is a little script that'll merge/sort all the files to one single journal, and then I'll run ledger on that.


Regards,
Dan

--

---
You received this message because you are subscribed to the Google Groups "Ledger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ledger-cli+...@googlegroups.com.

Alexandre Rademaker

unread,
Mar 6, 2018, 4:40:24 AM3/6/18
to ledge...@googlegroups.com
Perfect , UUID is the one I was trying to remember. Can you share the script and examples ?

Sent from my iPhone

o1bigtenor

unread,
Mar 6, 2018, 7:59:00 AM3/6/18
to ledge...@googlegroups.com
Greetings

I have had this issue for many years. So I compromised - - - :-)  !
All of my finances are logged in the same journal - - - but expenses that are personal are logged as personal - - - those that are blended are partially ascribed to personal or business with a division as is appropriate. Appropriate meaning justifiable and provable (which I believe would satisfy any auditor). Business expenses are logged as business expenses.
I also save my journal file after every month's data has been entered using the date of that saving as a subtend to the file name (to make it easy to find things if needed).
Am keeping up to 2 years of data in the active journal as I do lots of copy and paste (saves time on recurring transactions) and this (2 years of files) gives me a high likelihood of having a previous similar transaction. So after the start of the third year I stop including the first years information but then the journal 'name' is also changed.

AIUI business and personal is not supposed to be mixed but ledger enables me to specify by code which transactions are included in any calculations so I do think that I'm covered. As there is lots of personal funds still being used by the business - - - well I think its only expedient to mingle the two files whilst still keeping strict records (I am not trying to pass off ALL personal expenses as business expenses!!).

hth

Dee

Daniele Nicolodi

unread,
Mar 6, 2018, 9:40:47 AM3/6/18
to ledge...@googlegroups.com
Sure. Look a the `include` directive:

https://www.ledger-cli.org/3.0/doc/ledger3.html#index-include

Cheers,
Dan

Jostein Berntsen

unread,
Mar 6, 2018, 11:38:58 AM3/6/18
to ledge...@googlegroups.com
This article gives some input on how to do this:

https://felixcrux.com/blog/ledger-practices-separate-your-journals


Jostein
Reply all
Reply to author
Forward
0 new messages