doc: input files cleanup

This commit is contained in:
Simon Michael 2016-11-21 08:11:21 -08:00
parent b8d1698865
commit 64a877bff0

View File

@ -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,