diff options
author | Jonas Smedegaard <dr@jones.dk> | 2015-02-17 16:53:02 +0100 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2015-02-17 16:53:02 +0100 |
commit | 4b75c99ee7dc04285dcd9a204ad7430254f1455c (patch) | |
tree | b66b3e92af550ead7eb46885ce3133f61f82fd0b /bin | |
parent | 5286776eb41c6c742d1434f73b2dd8a819b18019 (diff) |
Fix apply simple-suffix CSV rules first.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/mycsv2ledger | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/mycsv2ledger b/bin/mycsv2ledger index b13e1b7..d01ced6 100755 --- a/bin/mycsv2ledger +++ b/bin/mycsv2ledger @@ -7,6 +7,9 @@ basename=$(basename "$infile" .csv) outfile="${2:-$basename.ledger}" rulesfile="$basename.rules" -cat "$basename".*.rules > "$rulesfile" +{ + find * -name "$infile.rules" -execdir cat '{}' +; + find * -name "$basename.*.rules" \! -name "$infile.rules" -execdir cat '{}' +; +} > "$rulesfile" hledger print --rules-file "$rulesfile" -f "$infile" > "$outfile" -[ "-d" = "$2" ] || rm "$rulesfile" +rm "$rulesfile" |