Skip to content

Instantly share code, notes, and snippets.

@Koronen
Created March 29, 2013 18:06
Show Gist options
  • Save Koronen/5272488 to your computer and use it in GitHub Desktop.
Save Koronen/5272488 to your computer and use it in GitHub Desktop.
Merge and clean Nordea account statements
PK_CSV_FILES=$(wildcard **/personkonto_*.csv)
.PHONY: default clean
default: personkonto.csv
personkonto.csv: $(PK_CSV_FILES)
@echo '"Datum","Transaktion","Kategori","Belopp","Saldo"' > $@
@cat $^ | sed -n -e 's/"\?Datum"\?.\+//' \
-e 's/\.\([0-9][0-9][0-9]\)/\1/g' \
-e 's/"\(-\?\)\([0-9]\+\),\([0-9][0-9]\)"/\1\2.\3/g' \
-e '/^\S/p' \
| sort >> $@
clean:
@rm -f personkonto.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment