Skip to content

Instantly share code, notes, and snippets.

@snake66
Created February 27, 2015 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save snake66/e3627fb5b555ece25966 to your computer and use it in GitHub Desktop.
Save snake66/e3627fb5b555ece25966 to your computer and use it in GitHub Desktop.
# 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