I wrote a (albeit-hacky) python script to do this for my ledger and made it 
public here: 
https://github.com/robmargo/beancount_tools/blob/master/sort_transactions.py

It ignores all lines before a line that has the text "TRANSACTIONS" 
(everything above that line is account openings/metadata that I dont want 
to sort). If you need help tweaking this for your needs, let me know.

On Friday, December 20, 2019 at 9:30:37 AM UTC-5, nug get wrote:
>
> thanks, a python script would probably do it in the end.
> is there a beancount function that would return all objects in my ledger 
> file as list or something? Writing that myself would be beyond my current 
> capabilities, or of irresponsible effort timewise :)
>
>
>
> On Friday, 20 December 2019 13:57:54 UTC+1, Martin Blais wrote:
>>
>> You will want to write a little python script.
>> I would operate on source code, not on the data structures, so you keep 
>> the original formatting and metadata and comments
>>
>> On Fri, Dec 20, 2019, 06:59 nug get <[email protected]> wrote:
>>
>>> Is there a feature that would allow me to sort the transactions in my 
>>> files, for example by date, or specific accounts?
>>> Thanks!
>>>
>>> Background:
>>> I migrated my 3 years of Gnucash records to beancount. It's all one long 
>>> list of transactions sorted by date. I'd like to separate my cash and bank 
>>> account transactions into two different files.
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Beancount" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected].
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/beancount/4b6c37cd-dab7-4683-80fc-e6affac7e1ca%40googlegroups.com
>>>  
>>> <https://groups.google.com/d/msgid/beancount/4b6c37cd-dab7-4683-80fc-e6affac7e1ca%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/daf5d985-aaf2-4169-8fda-ffb1af5b6530%40googlegroups.com.

Reply via email to