summaryrefslogtreecommitdiff
path: root/bin/mycsv2ledger
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2018-07-03 00:45:38 +0200
committerJonas Smedegaard <dr@jones.dk>2018-07-03 00:45:38 +0200
commit24a0eb30b323d0fac2a4717330e507175d5feff5 (patch)
treec2ed349be084df5e1a1c21f9f543218a21880acb /bin/mycsv2ledger
parent42cfe15a0c8be7da2f20fa4fa5e89c320f5c80d9 (diff)
Restructure loading: Apply primo explicitly. Apply ultime. Apply defaults before loading each dir. Generate bank ledger with dot as floating-point separator.
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"