@@ -3321,9 +3321,27 @@ If hledger's CSV rules aren't enough, you can pre-process the downloaded data he
33213321The command will be executed by your default shell, in the directory of the rules file, will receive the data file's content as standard input,
33223322and should output zero or more lines of character-separated-values, suitable for conversion by the CSV rules.
33233323
3324+ Examples:
3325+ ```
3326+ source ./paypal.json | paypalcsv
3327+ source data/simplefin.json | simplefincsv - 'chase.*card'
3328+ source OfxDownload*.csv | grep -vE '^(([^,]*,){6}[^,]*|)$' | sort -t, -n +2
3329+ source History_for_Account_Z20144832*.csv # | grep -E '^([^,]*,){12}[^,]*$' | sed -E -e 's/^ //' -e 's/\.([0-9]),/.\10,/g' -e 's/,([0-9]+),/,\1.00,/g'
3330+ ```
3331+
33243332Or, after ` source ` you can write ` | ` and a data generating command (with no file pattern before the ` | ` ).
33253333This command receives no input, and should output zero or more lines of character-separated values, suitable for conversion by the CSV rules.
33263334
3335+ Examples:
3336+ ```
3337+ source | paypaljson | paypalcsv
3338+ source | paypalcsv data/paypal.json
3339+ source | simplefinjson >data/simplefin.json && simplefincsv data/simplefin.json 'chase.*card'
3340+ source | simplefincsv data/simplefin.json 'unify.*checking'
3341+ ```
3342+
3343+ (` paypal* ` and ` simplefin* ` scripts are in [ bin/] ( https://github.com/simonmichael/hledger/tree/master/bin#readme ) )
3344+
33273345Whenever hledger runs one of these commands, it will print the command on stderr.
33283346If the command produces error output, but exits successfully, hledger will show the error output as a warning.
33293347If the command fails, hledger will fail and show the error output in the error message.
0 commit comments