summaryrefslogtreecommitdiff
path: root/bin/mycsv2ledger
diff options
context:
space:
mode:
Diffstat (limited to 'bin/mycsv2ledger')
-rwxr-xr-xbin/mycsv2ledger7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/mycsv2ledger b/bin/mycsv2ledger
index f59e3e3..56b1ccd 100755
--- a/bin/mycsv2ledger
+++ b/bin/mycsv2ledger
@@ -8,9 +8,14 @@ basename=$(basename "$infile" .csv)
outfile="${2:-$dirname/$basename.ledger}"
rulesfile="$dirname/$basename.rules"
+cat << EOF > "$outfile"
+D 1,000.00 kr
+
+EOF
+
{
find * -wholename "$infile.rules" -execdir cat '{}' +;
find * -wholename "$basename.*.rules" \! -name "$infile.rules" -execdir cat '{}' +;
} > "$rulesfile"
-hledger print --rules-file "$rulesfile" -f "$infile" > "$outfile"
+hledger print --rules-file "$rulesfile" -f "$infile" >> "$outfile"
rm "$rulesfile"