Created
December 26, 2011 09:25
-
-
Save buryat/1520803 to your computer and use it in GitHub Desktop.
VTB24 csv to QIF converter
This file contains 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
/* | |
* @description VTB24 csv to QIF converter | |
* @usage cat vtb.csv | node vtb_csv2qif.js > vtb.qif | |
* @url http://en.wikipedia.org/wiki/Quicken_Interchange_Format | |
*/ | |
var fs = require('fs'); | |
var vtb_csv = fs.readFileSync('/dev/stdin').toString(), | |
exchange_rate = 31.2575; | |
var vtb_qif = vtb_csv.replace( | |
/^"\d*?";"(.*?)";".*?";".*?";".*?";".*?";"(.*?)";"(.*?)"$/g, | |
function() { | |
return "D" + arguments[1] + "\nT" + arguments[2] / exchange_rate + "\nP" + arguments[3] + "\n^\n"; | |
} | |
); | |
console.log(vtb_qif); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment