diff options
author | Jonas Smedegaard <dr@jones.dk> | 2014-09-05 14:37:20 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2014-09-05 14:37:20 +0200 |
commit | dbbd076cf9bfa1c337cefd757bc636f808b0bda6 (patch) | |
tree | 995d70a7081b7cde5966003347cc615eabf467f9 /bin/mycsv2ledger | |
parent | da5727968ab7cd6c3e9068a7f0477bbc2141fc1a (diff) |
Split CSV parsing into scripts mycsv2ledger mymerkur2csv.
Diffstat (limited to 'bin/mycsv2ledger')
-rwxr-xr-x | bin/mycsv2ledger | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/bin/mycsv2ledger b/bin/mycsv2ledger new file mode 100755 index 0000000..b13e1b7 --- /dev/null +++ b/bin/mycsv2ledger @@ -0,0 +1,12 @@ +#!/bin/sh + +set -e + +infile="$1" +basename=$(basename "$infile" .csv) +outfile="${2:-$basename.ledger}" +rulesfile="$basename.rules" + +cat "$basename".*.rules > "$rulesfile" +hledger print --rules-file "$rulesfile" -f "$infile" > "$outfile" +[ "-d" = "$2" ] || rm "$rulesfile" |