Created
July 8, 2016 13:59
-
-
Save mrngm/d878aec4d4e162a325163e60d846666e 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
| #!/bin/bash | |
| echo "Date,Payee,Category,Memo,Outflow,Inflow" | |
| while IFS='' read -r line; do | |
| line=`echo "$line" | sed -e 's/\r//g'| tr -d \"` | |
| DATE=`echo "$line" | cut -d ';' -f 1 | tr - /` | |
| #DATE=`echo "$line" | cut -d ';' -f 1` | |
| PAYEE="OV-Chipkaart" | |
| #CATEGORY | |
| AMOUNT=`echo "$line" | cut -d ';' -f 6 | tr , .` | |
| TYPETRX=`echo "$line" | cut -d ';' -f 8` | |
| FROM=`echo "$line" | cut -d ';' -f 3` | |
| DEST=`echo "$line" | cut -d ';' -f 5` | |
| MEMO=`echo "$line" | cut -d ';' -f 9` | |
| REIS="$FROM - $DEST / $MEMO" | |
| #echo ${DATE},${PAYEE},,\"${TYPETRX} / ${MEMO}\",${OUTFLOW},${INFLOW} | |
| # assuming only negative transactions | |
| echo ${DATE},${PAYEE},,\"${REIS}\",${AMOUNT}, | |
| done < "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment