Skip to content

Commit ca474a8

Browse files
committed
;bal: doc: --commodity-column: fix csv example (#1626)
and make examples reproducible, why not.
1 parent d06d4ca commit ca474a8

1 file changed

Lines changed: 20 additions & 20 deletions

File tree

hledger/Hledger/Cli/Commands/Balance.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -263,43 +263,43 @@ In this mode, each report row will show amounts for a single commodity, using ex
263263
It can be useful for a cleaner display of reports with many commodities:
264264

265265
```shell
266-
$ hledger bal -T -Y
266+
$ hledger -f examples/bcexample.hledger bal assets:us:etrade -3 -T -Y
267267
Balance changes in 2012-01-01..2014-12-31:
268268

269-
|| 2012 2013 2014 Total
270-
==================++=============================================================================================================================
271-
Assets:US:ETrade || 10.00 ITOT, 337.18 USD, 2 more.. 70.00 GLD, 18.00 ITOT, 3 more.. -11.00 ITOT, 3 more.. 70.00 GLD, 17.00 ITOT, 3 more..
272-
------------------++-----------------------------------------------------------------------------------------------------------------------------
273-
total || 10.00 ITOT, 337.18 USD, 2 more.. 70.00 GLD, 18.00 ITOT, 3 more.. -11.00 ITOT, 3 more.. 70.00 GLD, 17.00 ITOT, 3 more..
269+
|| 2012 2013 2014 Total
270+
==================++===========================================================================================================================
271+
Assets:US:ETrade || 10.00 ITOT, 337.18 USD, 2 more.. 70.00 GLD, 18.00 ITOT, 3 more.. -11.00 ITOT, 3 more.. 70.00 GLD, 17.00 ITOT, 3 more..
272+
------------------++---------------------------------------------------------------------------------------------------------------------------
273+
|| 10.00 ITOT, 337.18 USD, 2 more.. 70.00 GLD, 18.00 ITOT, 3 more.. -11.00 ITOT, 3 more.. 70.00 GLD, 17.00 ITOT, 3 more..
274274

275-
$ hledger bal -T -Y --commodity-column
275+
$ hledger -f examples/bcexample.hledger bal assets:us:etrade -3 -T -Y --commodity-column
276276
Balance changes in 2012-01-01..2014-12-31:
277277

278-
|| Commodity 2012 2013 2014 Total
278+
|| Commodity 2012 2013 2014 Total
279279
==================++=============================================
280-
Assets:US:ETrade || GLD 0 70.00 0 70.00
281-
Assets:US:ETrade || ITOT 10.00 18.00 -11.00 17.00
282-
Assets:US:ETrade || USD 337.18 -98.12 4881.44 5120.50
283-
Assets:US:ETrade || VEA 12.00 10.00 14.00 36.00
284-
Assets:US:ETrade || VHT 106.00 18.00 170.00 294.00
280+
Assets:US:ETrade || GLD 0 70.00 0 70.00
281+
Assets:US:ETrade || ITOT 10.00 18.00 -11.00 17.00
282+
Assets:US:ETrade || USD 337.18 -98.12 4881.44 5120.50
283+
Assets:US:ETrade || VEA 12.00 10.00 14.00 36.00
284+
Assets:US:ETrade || VHT 106.00 18.00 170.00 294.00
285285
------------------++---------------------------------------------
286-
|| GLD 0 70.00 0 70.00
287-
|| ITOT 10.00 18.00 -11.00 17.00
288-
|| USD 337.18 -98.12 4881.44 5120.50
289-
|| VEA 12.00 10.00 14.00 36.00
290-
|| VHT 106.00 18.00 170.00 294.00
286+
|| GLD 0 70.00 0 70.00
287+
|| ITOT 10.00 18.00 -11.00 17.00
288+
|| USD 337.18 -98.12 4881.44 5120.50
289+
|| VEA 12.00 10.00 14.00 36.00
290+
|| VHT 106.00 18.00 170.00 294.00
291291
```
292292

293293
This flag also affects [CSV output](#output-formats),
294294
which is useful for producing data that is easier to consume, eg when making charts:
295295

296296
```shell
297-
$ hledger bal -T -O csv
297+
$ hledger -f examples/bcexample.hledger bal assets:us:etrade -3 -O csv
298298
"account","balance"
299299
"Assets:US:ETrade","70.00 GLD, 17.00 ITOT, 5120.50 USD, 36.00 VEA, 294.00 VHT"
300300
"total","70.00 GLD, 17.00 ITOT, 5120.50 USD, 36.00 VEA, 294.00 VHT"
301301

302-
$ hledger bal -T -O csv --commodity-column
302+
$ hledger -f examples/bcexample.hledger bal assets:us:etrade -3 -O csv --commodity-column
303303
"account","commodity","balance"
304304
"Assets:US:ETrade","GLD","70.00"
305305
"Assets:US:ETrade","ITOT","17.00"

0 commit comments

Comments
 (0)