Created
March 29, 2013 18:06
-
-
Save Koronen/5272488 to your computer and use it in GitHub Desktop.
Merge and clean Nordea account statements
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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