bal/etc.: document html output, move to options section

This commit is contained in:
Simon Michael 2018-01-23 17:08:19 -08:00
parent 37555617b7
commit e657e96591
6 changed files with 367 additions and 350 deletions

View File

@ -987,6 +987,33 @@ directives, not transaction prices (unlike Ledger).
Using \-B/\[en]cost and \-V/\[en]value together is currently allowed,
but the results are probably not meaningful.
Let us know if you find a use for this.
.SS Output destination
.PP
Some commands (print, register, stats, the balance commands) can write
their output to a destination other than the console.
This is controlled by the \f[C]\-o/\-\-output\-file\f[] option.
.IP
.nf
\f[C]
$\ hledger\ balance\ \-o\ \-\ \ \ \ \ #\ write\ to\ stdout\ (the\ default)
$\ hledger\ balance\ \-o\ FILE\ \ #\ write\ to\ FILE
\f[]
.fi
.SS Output format
.PP
Some commands can write their output in other formats.
Eg print and register can output CSV, and the balance commands can
output CSV or HTML.
This is controlled by the \f[C]\-O/\-\-output\-format\f[] option, or by
specifying a \f[C]\&.csv\f[] or \f[C]\&.html\f[] file extension with
\f[C]\-o/\-\-output\-file\f[].
.IP
.nf
\f[C]
$\ hledger\ balance\ \-O\ csv\ \ \ \ \ \ \ #\ write\ CSV\ to\ stdout
$\ hledger\ balance\ \-o\ FILE.csv\ \ #\ write\ CSV\ to\ FILE.csv
\f[]
.fi
.SS Regular expressions
.PP
hledger uses regular expressions in a number of places:
@ -1448,7 +1475,7 @@ in single\-column balance reports: use this custom line format
.TP
.B \f[C]\-O\ FMT\ \-\-output\-format=FMT\f[]
select the output format.
Supported formats: txt, csv.
Supported formats: txt, csv, html.
.RS
.RE
.TP
@ -1798,8 +1825,8 @@ Balance\ changes\ in\ 2017/11/01\-2017/12/31:
For more examples and details, see Budgeting and Forecasting.
.SS Custom balance output
.PP
In simple (non\-multi\-column) balance reports, you can customise the
output with \f[C]\-\-format\ FMT\f[]:
You can customise the layout of simple (non\-tabular) balance reports
with \f[C]\-\-format\ FMT\f[]:
.IP
.nf
\f[C]
@ -1867,6 +1894,8 @@ rendered on one line
.IP \[bu] 2
\f[C]%20(total)\ \ %2(depth_spacer)%\-(account)\f[] \- the default
format for the single\-column balance report
.PP
This command also supports output destination and output formats.
.SS Colour support
.PP
The balance command shows negative amounts in red, if:
@ -1874,33 +1903,6 @@ The balance command shows negative amounts in red, if:
the \f[C]TERM\f[] environment variable is not set to \f[C]dumb\f[]
.IP \[bu] 2
the output is not being redirected or piped anywhere
.SS Output destination
.PP
The balance, print, register and stats commands can write their output
to a destination other than the console.
This is controlled by the \f[C]\-o/\-\-output\-file\f[] option.
.IP
.nf
\f[C]
$\ hledger\ balance\ \-o\ \-\ \ \ \ \ #\ write\ to\ stdout\ (the\ default)
$\ hledger\ balance\ \-o\ FILE\ \ #\ write\ to\ FILE
\f[]
.fi
.SS CSV output
.PP
The balance, print and register commands can write their output as CSV.
This is useful for exporting data to other applications, eg to make
charts in a spreadsheet.
This is controlled by the \f[C]\-O/\-\-output\-format\f[] option, or by
specifying a \f[C]\&.csv\f[] file extension with
\f[C]\-o/\-\-output\-file\f[].
.IP
.nf
\f[C]
$\ hledger\ balance\ \-O\ csv\ \ \ \ \ \ \ #\ write\ CSV\ to\ stdout
$\ hledger\ balance\ \-o\ FILE.csv\ \ #\ write\ CSV\ to\ FILE.csv
\f[]
.fi
.SS balancesheet
.PP
This command displays a simple balance sheet, showing historical ending
@ -2011,6 +2013,8 @@ As with multicolumn balance reports, you can alter the report mode with
Normally balancesheet shows historical ending balances, which is what
you need for a balance sheet; note this means it ignores report begin
dates.
.PP
This command also supports output destination and output formats.
.SS balancesheetequity
.PP
Just like balancesheet, but also reports Equity (which it assumes is
@ -2146,6 +2150,8 @@ report period.
Normally cashflow shows changes in assets per period, though as with
multicolumn balance reports you can alter the report mode with
\f[C]\-\-change\f[]/\f[C]\-\-cumulative\f[]/\f[C]\-\-historical\f[].
.PP
This command also supports output destination and output formats.
.SS check\-dates
.PP
Check that transactions are sorted by increasing date.
@ -2343,6 +2349,8 @@ report period.
Normally incomestatement shows revenues/expenses per period, though as
with multicolumn balance reports you can alter the report mode with
\f[C]\-\-change\f[]/\f[C]\-\-cumulative\f[]/\f[C]\-\-historical\f[].
.PP
This command also supports output destination and output formats.
.SS prices
.PP
Print all market prices from the journal.
@ -2455,7 +2463,7 @@ increasing dates, and that transactions on the same day do not get
reordered.
See also the import command.
.PP
The print command also supports output destination and CSV output.
This command also supports output destination and output formats.
Here's an example of print's CSV output:
.IP
.nf
@ -2667,9 +2675,7 @@ $\ hledger\ reg\ \-w\ $COLUMNS,40\ \ \ \ \ \ #\ use\ terminal\ width,\ and\ set\
\f[]
.fi
.PP
The register command also supports the \f[C]\-o/\-\-output\-file\f[] and
\f[C]\-O/\-\-output\-format\f[] options for controlling output
destination and CSV output.
This command also supports output destination and output formats.
.SS register\-match
.PP
Print the one posting whose transaction description is closest to DESC,
@ -2708,8 +2714,7 @@ The stats command displays summary information for the whole journal, or
a matched part of it.
With a reporting interval, it shows a report for each report period.
.PP
The stats command also supports \f[C]\-o/\-\-output\-file\f[] for
controlling output destination.
This command also supports output destination and output formats.
.SS tags
.PP
List all the tag names used in the journal.

View File

@ -681,6 +681,37 @@ File: hledger.info, Node: Combining -B and -V, Next: Regular expressions, Pre
Using -B/-cost and -V/-value together is currently allowed, but the
results are probably not meaningful. Let us know if you find a use for
this.
* Menu:
* Output destination::
* Output format::

File: hledger.info, Node: Output destination, Next: Output format, Up: Combining -B and -V
2.15.1 Output destination
-------------------------
Some commands (print, register, stats, the balance commands) can write
their output to a destination other than the console. This is
controlled by the '-o/--output-file' option.
$ hledger balance -o - # write to stdout (the default)
$ hledger balance -o FILE # write to FILE

File: hledger.info, Node: Output format, Prev: Output destination, Up: Combining -B and -V
2.15.2 Output format
--------------------
Some commands can write their output in other formats. Eg print and
register can output CSV, and the balance commands can output CSV or
HTML. This is controlled by the '-O/--output-format' option, or by
specifying a '.csv' or '.html' file extension with '-o/--output-file'.
$ hledger balance -O csv # write CSV to stdout
$ hledger balance -o FILE.csv # write CSV to FILE.csv

File: hledger.info, Node: Regular expressions, Prev: Combining -B and -V, Up: OPTIONS
@ -1084,7 +1115,7 @@ Show accounts and their balances. Aliases: b, bal.
in single-column balance reports: use this custom line format
'-O FMT --output-format=FMT'
select the output format. Supported formats: txt, csv.
select the output format. Supported formats: txt, csv, html.
'-o FILE --output-file=FILE'
write output to FILE. A file extension matching one of the above
@ -1159,8 +1190,6 @@ $ hledger balance -p 2008/6 expenses --no-total
* Budgets::
* Custom balance output::
* Colour support::
* Output destination::
* CSV output::

File: hledger.info, Node: Flat mode, Next: Depth limited balance reports, Up: balance
@ -1393,8 +1422,8 @@ File: hledger.info, Node: Custom balance output, Next: Colour support, Prev:
4.4.5 Custom balance output
---------------------------
In simple (non-multi-column) balance reports, you can customise the
output with '--format FMT':
You can customise the layout of simple (non-tabular) balance reports
with '--format FMT':
$ hledger balance --format "%20(account) %12(total)"
assets $-1
@ -1447,8 +1476,10 @@ may be needed to get pleasing results.
* '%20(total) %2(depth_spacer)%-(account)' - the default format for
the single-column balance report
This command also supports output destination and output formats.

File: hledger.info, Node: Colour support, Next: Output destination, Prev: Custom balance output, Up: balance
File: hledger.info, Node: Colour support, Prev: Custom balance output, Up: balance
4.4.6 Colour support
--------------------
@ -1458,34 +1489,6 @@ The balance command shows negative amounts in red, if:
* the 'TERM' environment variable is not set to 'dumb'
* the output is not being redirected or piped anywhere

File: hledger.info, Node: Output destination, Next: CSV output, Prev: Colour support, Up: balance
4.4.7 Output destination
------------------------
The balance, print, register and stats commands can write their output
to a destination other than the console. This is controlled by the
'-o/--output-file' option.
$ hledger balance -o - # write to stdout (the default)
$ hledger balance -o FILE # write to FILE

File: hledger.info, Node: CSV output, Prev: Output destination, Up: balance
4.4.8 CSV output
----------------
The balance, print and register commands can write their output as CSV.
This is useful for exporting data to other applications, eg to make
charts in a spreadsheet. This is controlled by the '-O/--output-format'
option, or by specifying a '.csv' file extension with
'-o/--output-file'.
$ hledger balance -O csv # write CSV to stdout
$ hledger balance -o FILE.csv # write CSV to FILE.csv

File: hledger.info, Node: balancesheet, Next: balancesheetequity, Prev: balance, Up: COMMANDS
@ -1569,6 +1572,8 @@ the report mode with '--change'/'--cumulative'/'--historical'. Normally
balancesheet shows historical ending balances, which is what you need
for a balance sheet; note this means it ignores report begin dates.
This command also supports output destination and output formats.

File: hledger.info, Node: balancesheetequity, Next: cashflow, Prev: balancesheet, Up: COMMANDS
@ -1679,6 +1684,8 @@ each report period. Normally cashflow shows changes in assets per
period, though as with multicolumn balance reports you can alter the
report mode with '--change'/'--cumulative'/'--historical'.
This command also supports output destination and output formats.

File: hledger.info, Node: check-dates, Next: check-dupes, Prev: cashflow, Up: COMMANDS
@ -1856,6 +1863,8 @@ each report period. Normally incomestatement shows revenues/expenses
per period, though as with multicolumn balance reports you can alter the
report mode with '--change'/'--cumulative'/'--historical'.
This command also supports output destination and output formats.

File: hledger.info, Node: prices, Next: print, Prev: incomestatement, Up: COMMANDS
@ -1951,7 +1960,7 @@ $ hledger -f bank1.csv print --new
increasing dates, and that transactions on the same day do not get
reordered. See also the import command.
The print command also supports output destination and CSV output.
This command also supports output destination and output formats.
Here's an example of print's CSV output:
$ hledger print -Ocsv
@ -2122,9 +2131,7 @@ $ export COLUMNS=100; hledger reg # set till session end (or window resize)
$ hledger reg -w 100,40 # set overall width 100, description width 40
$ hledger reg -w $COLUMNS,40 # use terminal width, and set description width
The register command also supports the '-o/--output-file' and
'-O/--output-format' options for controlling output destination and CSV
output.
This command also supports output destination and output formats.

File: hledger.info, Node: register-match, Next: rewrite, Prev: register, Up: COMMANDS
@ -2173,8 +2180,7 @@ Commodities : 1 ($)
or a matched part of it. With a reporting interval, it shows a report
for each report period.
The stats command also supports '-o/--output-file' for controlling
output destination.
This command also supports output destination and output formats.

File: hledger.info, Node: tags, Next: test, Prev: stats, Up: COMMANDS
@ -2418,103 +2424,103 @@ Node: Market value21197
Ref: #market-value21332
Node: Combining -B and -V22515
Ref: #combining--b-and--v22679
Node: Regular expressions22826
Ref: #regular-expressions22969
Node: QUERIES24330
Ref: #queries24432
Node: COMMANDS28399
Ref: #commands28511
Node: accounts29493
Ref: #accounts29591
Node: activity30837
Ref: #activity30947
Node: add31307
Ref: #add31406
Node: balance34067
Ref: #balance34178
Node: Flat mode37658
Ref: #flat-mode37783
Node: Depth limited balance reports38203
Ref: #depth-limited-balance-reports38404
Node: Multicolumn balance reports38824
Ref: #multicolumn-balance-reports39019
Node: Budgets43708
Ref: #budgets43855
Node: Custom balance output47686
Ref: #custom-balance-output47848
Node: Colour support49941
Ref: #colour-support50100
Node: Output destination50273
Ref: #output-destination50429
Node: CSV output50699
Ref: #csv-output50816
Node: balancesheet51213
Ref: #balancesheet51349
Node: balancesheetequity53581
Ref: #balancesheetequity53730
Node: cashflow54267
Ref: #cashflow54395
Node: check-dates56439
Ref: #check-dates56566
Node: check-dupes56683
Ref: #check-dupes56807
Node: close56944
Ref: #close57051
Node: help57381
Ref: #help57481
Node: import58555
Ref: #import58669
Node: incomestatement59399
Ref: #incomestatement59533
Node: prices61858
Ref: #prices61973
Node: print62016
Ref: #print62126
Node: print-unique67011
Ref: #print-unique67137
Node: register67205
Ref: #register67332
Node: Custom register output71833
Ref: #custom-register-output71962
Node: register-match73259
Ref: #register-match73393
Node: rewrite73576
Ref: #rewrite73693
Node: stats73762
Ref: #stats73865
Node: tags74747
Ref: #tags74845
Node: test75081
Ref: #test75165
Node: ADD-ON COMMANDS75533
Ref: #add-on-commands75643
Node: Official add-ons76930
Ref: #official-add-ons77070
Node: api77157
Ref: #api77246
Node: ui77298
Ref: #ui77397
Node: web77455
Ref: #web77544
Node: Third party add-ons77590
Ref: #third-party-add-ons77765
Node: diff77900
Ref: #diff77997
Node: iadd78096
Ref: #iadd78210
Node: interest78293
Ref: #interest78414
Node: irr78509
Ref: #irr78607
Node: Experimental add-ons78685
Ref: #experimental-add-ons78837
Node: autosync79128
Ref: #autosync79240
Node: budget79479
Ref: #budget79601
Node: chart79667
Ref: #chart79784
Node: check79855
Ref: #check79957
Node: Output destination22876
Ref: #output-destination23026
Node: Output format23309
Ref: #output-format23449
Node: Regular expressions23834
Ref: #regular-expressions23977
Node: QUERIES25338
Ref: #queries25440
Node: COMMANDS29407
Ref: #commands29519
Node: accounts30501
Ref: #accounts30599
Node: activity31845
Ref: #activity31955
Node: add32315
Ref: #add32414
Node: balance35075
Ref: #balance35186
Node: Flat mode38634
Ref: #flat-mode38759
Node: Depth limited balance reports39179
Ref: #depth-limited-balance-reports39380
Node: Multicolumn balance reports39800
Ref: #multicolumn-balance-reports39995
Node: Budgets44684
Ref: #budgets44831
Node: Custom balance output48662
Ref: #custom-balance-output48824
Node: Colour support50981
Ref: #colour-support51113
Node: balancesheet51286
Ref: #balancesheet51422
Node: balancesheetequity53724
Ref: #balancesheetequity53873
Node: cashflow54410
Ref: #cashflow54538
Node: check-dates56652
Ref: #check-dates56779
Node: check-dupes56896
Ref: #check-dupes57020
Node: close57157
Ref: #close57264
Node: help57594
Ref: #help57694
Node: import58768
Ref: #import58882
Node: incomestatement59612
Ref: #incomestatement59746
Node: prices62141
Ref: #prices62256
Node: print62299
Ref: #print62409
Node: print-unique67293
Ref: #print-unique67419
Node: register67487
Ref: #register67614
Node: Custom register output72115
Ref: #custom-register-output72244
Node: register-match73465
Ref: #register-match73599
Node: rewrite73782
Ref: #rewrite73899
Node: stats73968
Ref: #stats74071
Node: tags74932
Ref: #tags75030
Node: test75266
Ref: #test75350
Node: ADD-ON COMMANDS75718
Ref: #add-on-commands75828
Node: Official add-ons77115
Ref: #official-add-ons77255
Node: api77342
Ref: #api77431
Node: ui77483
Ref: #ui77582
Node: web77640
Ref: #web77729
Node: Third party add-ons77775
Ref: #third-party-add-ons77950
Node: diff78085
Ref: #diff78182
Node: iadd78281
Ref: #iadd78395
Node: interest78478
Ref: #interest78599
Node: irr78694
Ref: #irr78792
Node: Experimental add-ons78870
Ref: #experimental-add-ons79022
Node: autosync79313
Ref: #autosync79425
Node: budget79664
Ref: #budget79786
Node: chart79852
Ref: #chart79969
Node: check80040
Ref: #check80142

End Tag Table

View File

@ -635,6 +635,23 @@ OPTIONS
results are probably not meaningful. Let us know if you find a use for
this.
Output destination
Some commands (print, register, stats, the balance commands) can write
their output to a destination other than the console. This is con-
trolled by the -o/--output-file option.
$ hledger balance -o - # write to stdout (the default)
$ hledger balance -o FILE # write to FILE
Output format
Some commands can write their output in other formats. Eg print and
register can output CSV, and the balance commands can output CSV or
HTML. This is controlled by the -O/--output-format option, or by spec-
ifying a .csv or .html file extension with -o/--output-file.
$ hledger balance -O csv # write CSV to stdout
$ hledger balance -o FILE.csv # write CSV to FILE.csv
Regular expressions
hledger uses regular expressions in a number of places:
@ -987,7 +1004,7 @@ COMMANDS
in single-column balance reports: use this custom line format
-O FMT --output-format=FMT
select the output format. Supported formats: txt, csv.
select the output format. Supported formats: txt, csv, html.
-o FILE --output-file=FILE
write output to FILE. A file extension matching one of the
@ -1260,8 +1277,8 @@ COMMANDS
For more examples and details, see Budgeting and Forecasting.
Custom balance output
In simple (non-multi-column) balance reports, you can customise the
output with --format FMT:
You can customise the layout of simple (non-tabular) balance reports
with --format FMT:
$ hledger balance --format "%20(account) %12(total)"
assets $-1
@ -1323,6 +1340,8 @@ COMMANDS
o %20(total) %2(depth_spacer)%-(account) - the default format for the
single-column balance report
This command also supports output destination and output formats.
Colour support
The balance command shows negative amounts in red, if:
@ -1330,23 +1349,6 @@ COMMANDS
o the output is not being redirected or piped anywhere
Output destination
The balance, print, register and stats commands can write their output
to a destination other than the console. This is controlled by the
-o/--output-file option.
$ hledger balance -o - # write to stdout (the default)
$ hledger balance -o FILE # write to FILE
CSV output
The balance, print and register commands can write their output as CSV.
This is useful for exporting data to other applications, eg to make
charts in a spreadsheet. This is controlled by the -O/--output-format
option, or by specifying a .csv file extension with -o/--output-file.
$ hledger balance -O csv # write CSV to stdout
$ hledger balance -o FILE.csv # write CSV to FILE.csv
balancesheet
This command displays a simple balance sheet, showing historical ending
balances of asset and liability accounts (ignoring any report begin
@ -1422,6 +1424,8 @@ COMMANDS
ancesheet shows historical ending balances, which is what you need for
a balance sheet; note this means it ignores report begin dates.
This command also supports output destination and output formats.
balancesheetequity
Just like balancesheet, but also reports Equity (which it assumes is
under a top-level equity account).
@ -1519,6 +1523,8 @@ COMMANDS
though as with multicolumn balance reports you can alter the report
mode with --change/--cumulative/--historical.
This command also supports output destination and output formats.
check-dates
Check that transactions are sorted by increasing date. With a query,
only matched transactions' dates are checked.
@ -1662,6 +1668,8 @@ COMMANDS
period, though as with multicolumn balance reports you can alter the
report mode with --change/--cumulative/--historical.
This command also supports output destination and output formats.
prices
Print all market prices from the journal.
@ -1745,7 +1753,7 @@ COMMANDS
increasing dates, and that transactions on the same day do not get
reordered. See also the import command.
The print command also supports output destination and CSV output.
This command also supports output destination and output formats.
Here's an example of print's CSV output:
$ hledger print -Ocsv
@ -1899,8 +1907,7 @@ COMMANDS
$ hledger reg -w 100,40 # set overall width 100, description width 40
$ hledger reg -w $COLUMNS,40 # use terminal width, and set description width
The register command also supports the -o/--output-file and -O/--out-
put-format options for controlling output destination and CSV output.
This command also supports output destination and output formats.
register-match
Print the one posting whose transaction description is closest to DESC,
@ -1933,8 +1940,7 @@ COMMANDS
or a matched part of it. With a reporting interval, it shows a report
for each report period.
The stats command also supports -o/--output-file for controlling output
destination.
This command also supports output destination and output formats.
tags
List all the tag names used in the journal. With a TAGREGEX argument,

View File

@ -36,7 +36,7 @@ Show accounts and their balances. Aliases: b, bal.
`-O FMT --output-format=FMT `
: select the output format. Supported formats:
txt, csv.
txt, csv, html.
`-o FILE --output-file=FILE`
: write output to FILE. A file extension matching one of the above formats selects that format.
@ -336,8 +336,7 @@ For more examples and details, see [Budgeting and Forecasting](budgeting-and-for
### Custom balance output
In simple (non-multi-column) balance reports, you can customise the
output with `--format FMT`:
You can customise the layout of simple (non-tabular) balance reports with `--format FMT`:
```shell
$ hledger balance --format "%20(account) %12(total)"
@ -391,6 +390,8 @@ Some example formats:
- `%,%-50(account) %25(total)` - account name padded to 50 characters, total padded to 20 characters, with multiple commodities rendered on one line
- `%20(total) %2(depth_spacer)%-(account)` - the default format for the single-column balance report
This command also supports [output destination](/manual.html#output-destination) and [output formats](/manual.html#output-formats).
### Colour support
The balance command shows negative amounts in red, if:
@ -398,27 +399,4 @@ The balance command shows negative amounts in red, if:
- the `TERM` environment variable is not set to `dumb`
- the output is not being redirected or piped anywhere
### Output destination
The balance, print, register and stats commands can write their output to a
destination other than the console. This is controlled by the
`-o/--output-file` option.
```shell
$ hledger balance -o - # write to stdout (the default)
$ hledger balance -o FILE # write to FILE
```
### CSV output
The balance, print and register commands can write their output as
CSV. This is useful for exporting data to other applications, eg to
make charts in a spreadsheet. This is controlled by the
`-O/--output-format` option, or by specifying a `.csv` file extension
with `-o/--output-file`.
```shell
$ hledger balance -O csv # write CSV to stdout
$ hledger balance -o FILE.csv # write CSV to FILE.csv
```

View File

@ -250,6 +250,8 @@ Normally balancesheet shows historical ending balances, which is what
you need for a balance sheet; note this means it ignores report begin
dates.
This command also supports [output destination](/manual.html#output-destination) and [output formats](/manual.html#output-formats).
## balancesheetequity
Just like [balancesheet](#balancesheet), but also reports Equity
(which it assumes is under a top-level `equity` account).
@ -349,6 +351,8 @@ Normally cashflow shows changes in assets per period, though
as with [multicolumn balance reports](#multicolumn-balance-reports)
you can alter the report mode with `--change`/`--cumulative`/`--historical`.
This command also supports [output destination](/manual.html#output-destination) and [output formats](/manual.html#output-formats).
## check-dates
Check that transactions are sorted by increasing date.
With a query, only matched transactions' dates are checked.
@ -499,6 +503,8 @@ Normally incomestatement shows revenues/expenses per period, though
as with [multicolumn balance reports](#multicolumn-balance-reports)
you can alter the report mode with `--change`/`--cumulative`/`--historical`.
This command also supports [output destination](/manual.html#output-destination) and [output formats](/manual.html#output-formats).
## prices
Print all [market prices](/manual#market-prices) from the journal.
@ -579,10 +585,7 @@ This assumes that transactions added to FILE always have same or increasing date
and that transactions on the same day do not get reordered.
See also the [import](#import) command.
The print command also supports
[output destination](#output-destination)
and
[CSV output](#csv-output).
This command also supports [output destination](/manual.html#output-destination) and [output formats](/manual.html#output-formats).
Here's an example of print's CSV output:
```shell
$ hledger print -Ocsv
@ -737,9 +740,7 @@ $ hledger reg -w 100,40 # set overall width 100, description width 40
$ hledger reg -w $COLUMNS,40 # use terminal width, and set description width
```
The register command also supports the
`-o/--output-file` and `-O/--output-format` options for controlling
[output destination](#output-destination) and [CSV output](#csv-output).
This command also supports [output destination](/manual.html#output-destination) and [output formats](/manual.html#output-formats).
## register-match
Print the one posting whose transaction description is closest to DESC,
@ -773,8 +774,7 @@ The stats command displays summary information for the whole journal, or
a matched part of it. With a [reporting interval](#reporting-interval),
it shows a report for each report period.
The stats command also supports `-o/--output-file`
for controlling [output destination](#output-destination).
This command also supports [output destination](/manual.html#output-destination) and [output formats](/manual.html#output-formats).
## tags
List all the tag names used in the journal. With a TAGREGEX argument,

View File

@ -414,6 +414,28 @@ not [transaction prices](journal.html#transaction-prices) (unlike Ledger).
Using -B/--cost and -V/--value together is currently allowed, but the
results are probably not meaningful. Let us know if you find a use for this.
### Output destination
Some commands (print, register, stats, the balance commands)
can write their output to a destination other than the console.
This is controlled by the `-o/--output-file` option.
```shell
$ hledger balance -o - # write to stdout (the default)
$ hledger balance -o FILE # write to FILE
```
### Output format
Some commands can write their output in other formats.
Eg print and register can output CSV, and the balance commands can output CSV or HTML.
This is controlled by the `-O/--output-format` option, or by specifying a `.csv` or `.html` file extension with `-o/--output-file`.
```shell
$ hledger balance -O csv # write CSV to stdout
$ hledger balance -o FILE.csv # write CSV to FILE.csv
```
## Regular expressions
hledger uses [regular expressions](http://www.regular-expressions.info) in a number of places: