Export

We can export transactions in CSV format.

Example

Run ledger -f ledger.dat export

2021/12/01,Checking balance,Assets:Bank:Checking,1000.00
2021/12/01,Checking balance,Equity:Opening Balances,-1000.00
2021/12/05,Withdrawl,Assets:Bank:Checking,-100.00
2021/12/05,Withdrawl,Assets:Cash:Wallet,100.00
2021/12/22,Grocery Store,Assets:Bank:Checking,-222.00
2021/12/22,Grocery Store,Expenses:Food:Groceries,222.00
2021/12/25,Buy some Crypto,Assets:Bank:Checking,-500.00
2021/12/25,Buy some Crypto,Assets:Crypto:BTC,300.00
2021/12/25,Buy some Crypto,Assets:Crypto:ETH,200.00
2021/12/31,Employer,Assets:Bank:Checking,2000.00
2021/12/31,Employer,Income:Salary,-2000.00
2022/01/02,Dominoes Pizza   HOUSTON TX,Liabilities:MasterCard,-23.58
2022/01/02,Dominoes Pizza   HOUSTON TX,Expenses:Food:TakeOut,23.58
2022/01/02,Grocery Store,Assets:Bank:Checking,-145.00
2022/01/02,Grocery Store,Expenses:Food:Groceries,145.00
2022/01/02,Grocery Store,Assets:Bank:Checking,-180.00
2022/01/02,Grocery Store,Expenses:Food:Groceries,180.00
2022/01/08,Half Price Books    HOUSTON TX,Liabilities:MasterCard,-20.00
2022/01/08,Half Price Books    HOUSTON TX,Expenses:Books,20.00
2022/01/09,Grocery Store,Assets:Bank:Checking,-120.00
2022/01/09,Grocery Store,Expenses:Food:Groceries,120.00
2022/01/11,Panda Express,Liabilities:MasterCard,-17.34
2022/01/11,Panda Express,Expenses:Food:TakeOut,17.34
2022/01/15,Employer,Assets:Bank:Checking,2000.00
2022/01/15,Employer,Income:Salary,-2000.00

By default columns are comma separated. To use another delimiter use the --delimiter flag e.g.

ledger -f ledger.dat --delimiter $'\t' export

$'\t' will produce a literal tab character in Bash shell environment.

2021/12/01	Checking balance	Assets:Bank:Checking	1000.00
2021/12/01	Checking balance	Equity:Opening Balances	-1000.00
2021/12/05	Withdrawl	Assets:Bank:Checking	-100.00
2021/12/05	Withdrawl	Assets:Cash:Wallet	100.00
2021/12/22	Grocery Store	Assets:Bank:Checking	-222.00
2021/12/22	Grocery Store	Expenses:Food:Groceries	222.00
2021/12/25	Buy some Crypto	Assets:Bank:Checking	-500.00
2021/12/25	Buy some Crypto	Assets:Crypto:BTC	300.00
2021/12/25	Buy some Crypto	Assets:Crypto:ETH	200.00
2021/12/31	Employer	Assets:Bank:Checking	2000.00
2021/12/31	Employer	Income:Salary	-2000.00
2022/01/02	Dominoes Pizza   HOUSTON TX	Liabilities:MasterCard	-23.58
2022/01/02	Dominoes Pizza   HOUSTON TX	Expenses:Food:TakeOut	23.58
2022/01/02	Grocery Store	Assets:Bank:Checking	-145.00
2022/01/02	Grocery Store	Expenses:Food:Groceries	145.00
2022/01/02	Grocery Store	Assets:Bank:Checking	-180.00
2022/01/02	Grocery Store	Expenses:Food:Groceries	180.00
2022/01/08	Half Price Books    HOUSTON TX	Liabilities:MasterCard	-20.00
2022/01/08	Half Price Books    HOUSTON TX	Expenses:Books	20.00
2022/01/09	Grocery Store	Assets:Bank:Checking	-120.00
2022/01/09	Grocery Store	Expenses:Food:Groceries	120.00
2022/01/11	Panda Express	Liabilities:MasterCard	-17.34
2022/01/11	Panda Express	Expenses:Food:TakeOut	17.34
2022/01/15	Employer	Assets:Bank:Checking	2000.00
2022/01/15	Employer	Income:Salary	-2000.00