Open KhizarSultan opened 3 years ago
I was having a similar problem to @KhizarSultan, solved by passing the delimiter (which in my case was ;
) explicitly as a kwarg
of my read_csv
method.
ofx = OFX(mapping)
records = read_csv('mycsv.csv', delimiter=';')
# .. rest of code
Did the above suggestion work? If not, can you add a few lines of your csv file to the issue?
Same issues here. Some transactions with my data anonymised:
Posted Account, Posted Transactions Date, Description1, Description2, Description3, Debit Amount, Credit Amount,Balance,Posted Currency,Transaction Type,Local Currency Amount,Local Currency
"000000 - 0000000000","04/01/2022","V00000000000000","IE0000000000000","",,"140.00","1241.98",EUR,"Credit"," 140.00",EUR
"000000 - 0000000000","04/01/2022","VDP-BLAHBLAH","","","15.39",,"1226.59",EUR,"Debit"," 15.39",EUR
"000000 - 0000000000","04/01/2022","D/D SOMETHING","IE00000000000000","","14.00",,"1212.59",EUR,"Direct Debit"," 14.00",EUR
Here's my mapping file:
from operator import itemgetter
mapping = {
'bank':'AIB',
'account': itemgetter('Posted Account'),
'date': itemgetter('Posted Transactions Date'),
'desc': itemgetter('Description1'),
'note': itemgetter('Description2'),
'balance': itemgetter('Balence'),
'type': itemgetter('Transaction Type'),
'amount': itemgetter('Local Currency Amount'),
Thank you for the attention! My Problem Statement is: Convert .csv file into .ofx file using open source library. My Proposed Solution is: Use the csv2ofx python library to convert .csv file into .ofx
Description of csv file: My .csv file contains following columns:
Mapping: i apply the custom mapping (as i have different columns) given as follow:
Code: i write the following code to convert .csv to .ofx
Roadblocks :
When i run the code, It throw the following error:
I really appreciate as you took some time out to read my problem, Looking forward to hearing the suggestions or solutions from you. Thank you.