Ledger (http://ledger-cli.org/) allows to output reverse sorted balance of your Income accounts using the following command:
ledger -f money.txt bal Income --sort "-abs(total)"
so the output looks like follows:
$-7,715.00 Income
$-6,789.10 Payroll
$-567.89 Insurance
$-234.56 Gift Card
$-200.56 Store 1
$-34.00 Store 2
$-123.45 Coupons
Is there a way to output the same information in CSV format, but keeping the indentation of the categories as follows (header values are not important)?
"Amount","Level 1","Level 2,"Level 3"
$-7,715.00,Income,,
,$-6,789.10,Payroll,
,$-567.89,Insurance,
,$-234.56,Gift Card,
,,$-200.56,Store 1
,,$-34.00,Store 2
,$-123.45,Coupons,