Skip to content

Instantly share code, notes, and snippets.

@ebirn
Created May 31, 2014 13:49
Show Gist options
  • Save ebirn/d19b634a4e601e1eacb4 to your computer and use it in GitHub Desktop.
Save ebirn/d19b634a4e601e1eacb4 to your computer and use it in GitHub Desktop.
convert EasyBank.at .csv data to YNAB .csv format
#!/bin/sh
EBFILE=$1
echo "Date,Payee,Category,Memo,Outflow,Inflow"
awk 'BEGIN { FS=";"} {
inflow=0
outflow=0
date=$3
memo=$2
money=$5
sub("\\+", "", money)
sub("\\.", "", money)
sub(",", ".", money)
if (money < 0) { outflow = sqrt(money^2) }
if (money > 0) { inflow = money }
gsub("\\.", "/", date)
print date ",,,\"" memo "\"," outflow "," inflow
}' $EBFILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment