[GNC] CSV to QIF for Citibank
Greg Feneis
mfeneis at gmail.com
Mon Jun 17 01:51:52 EDT 2019
Not what you asked for, but what alternative file types does Citibank
provide besides CSV?
Kind regards, Greg Feneis
(Pixel 3)
On Sun, Jun 16, 2019, 22:17 Michael DeBusk <mdebusk at gmail.com> wrote:
> Some time back, Citibank decided it would stop offering its transactions in
> QIF format. I edited the CSV in vim (I only had a few transactions) until
> this past week, when I realized I can't be a good Linux nerd unless I
> automate repetitive tasks.
>
> This is my attempt at an awk script specific to Citibank's file format. The
> QIF needs some editing after it's done, but it'll save me a lot of time
> until they change the format again.
>
> (I'd appreciate criticism from awk masters on the list.)
>
> #!/usr/bin/awk -f
> BEGIN {
> FS=","
> print "!Account"
> print "NLiabilities:Citibank:Costco Anywhere Visa" # Change to your
> account
> print "TCCard"
> print "\\Statement Balance Date"
> print "$Statement Balance"
> print "^"
> print "!Type:CCard"
> }
> FNR == 1 { next }
> {
> print "D"$2
> if ($3~/AUTOPAY/) {
> print "PCitibank";
> print "T"sqrt($5^2); # This gets rid of the "-" before the amount
> print "LAssets:Current Assets:"; # change to your checking account
> print "MAutopay";
> }
> else {
> print "P"tolower(substr($3, 2, length($3)-2)); # This gets rid of
> the double quotes around this string, and lower-case it
> print "T-"$4;
> print "LExpenses:&&";
> print "M&&";
> }
> print "^"
> }
>
> --
> Home: http://nlphilia.com * Blog: http://nlphilia.net
> Registered Linux User #450983 * Ubuntu Counter Project #10548
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at gnucash.org
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> If you are using Nabble or Gmane, please see
> https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.
>
More information about the gnucash-user
mailing list