From 64a877bff09edb755b9c0d0a1cf1c98d14fbdd01 Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Mon, 21 Nov 2016 08:11:21 -0800 Subject: [PATCH] doc: input files cleanup --- hledger/doc/options.m4.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/hledger/doc/options.m4.md b/hledger/doc/options.m4.md index e14504746..74ee0eb5e 100644 --- a/hledger/doc/options.m4.md +++ b/hledger/doc/options.m4.md @@ -93,31 +93,31 @@ $ cat some.journal | hledger -f- ``` Usually this file is in hledger's journal format, -but it can also be one of several other formats, shown below. -hledger tries to identify the format based on the file extension, as follows: +but it can also be one of several other formats. +Each one is handled by a built-in "reader", as follows: -| Format: | Description: | File extensions: -|------------|---------------------------------------------|------------------------------------------- -| journal | hledger's journal format | `.journal`, `.j`, `.hledger`, `.ledger` -| timeclock | timeclock files (precise time logging) | `.timeclock` -| timedot | timedot files (approximate time logging) | `.timedot` -| CSV | comma-separated values (data interchange) | `.csv` +| Reader:   | Reads: | Used for file extensions: +|---------------------|-----------------------------------------------------|------------------------------------------- +| `journal` | hledger's journal format, also some Ledger journals | `.journal` `.j` `.hledger` `.ledger` +| `timeclock` | timeclock files (precise time logging) | `.timeclock` +| `timedot` | timedot files (approximate time logging) | `.timedot` +| `CSV` | comma-separated values (data interchange) | `.csv` -hledger identifies the format based on the file extension if possible. -If that does not identify a known format, it tries each format in turn. - -If needed, eg to ensure correct error messages, you can force a specific format +Usually hledger identifies the correct format automatically based on the file extension, +or if that does not work, by trying each format in turn. +If needed - eg to ensure correct error messages - you can force a specific format by prepending it to the file path with a colon. Examples: ```bash $ hledger -f csv:/some/csv-file.dat stats $ echo 'i 2009/13/1 08:00:00' | hledger print -ftimeclock:- ``` -Some other experimental formats are available but not yet used by default: +This experimental reader is also available but not used by default: + +| Reader:   | Reads: | File extensions: +|---------------------|---------------------------------------------|------------------------------------------- +| `ledger` | Ledger's journal format (incomplete) | -| Format: | Description: | File extensions: -|------------|---------------------------------------------|------------------------------------------- -| ledger | Ledger's journal format (incomplete) | You can specify multiple `-f` options, to read multiple files as one big journal. Directives in one file will not affect subsequent files in this case (if you need that,