Created
February 27, 2015 12:43
-
-
Save snake66/e3627fb5b555ece25966 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# A simple filter to mould the csv from nordea into | |
# something that can be swallowed by gnucash. | |
BEGIN { | |
FS = ";"; | |
RS = "\n"; | |
OFS = ";"; | |
ORS = "\n"; | |
# Regex for matching a date | |
DATE = /^[0-9]{4}\.[0-9]{2}\.[0-9]{2}$/; | |
} | |
# Only lines starting with a date should be printed | |
$2 ~ DATE { | |
# Strip negative sign from withdraw column | |
withdraw = gensub(/\-/, "", "g", $8); | |
print $2,$4,$6,withdraw,$10; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment