glarivie / revolut-csv-to-qif

Convert Revolut Excel (CSV) exports to QIF file
MIT License
5 stars 1 forks source link

NaN Values and surprising file encoding #1

Closed mpschr closed 5 years ago

mpschr commented 5 years ago

Hi

Great piece of code. It works almost for me, just the amount values are spit out as NaN. I imagine it has to do something with Enconding as the output file has a different encoding? Do you have a hunch what could go wrong here (on a OS X system).

Type:Bank
D13/03/2019
TNaN
P
^
D13/03/2019
TNaN
P
^

File encoding:

Revolut-EUR-Statement-Oct 2018 – Jan 2019.csv: text/plain; charset=utf-8
Revolut-Statement-13-03-2019.qif:              text/plain; charset=us-ascii
glarivie commented 5 years ago

Can you provide a subset of your Revolut CSV file ? I'll try to reproduce the error.

mpschr commented 5 years ago

HI

Completed Date ; Description ; Paid Out (EUR) ; Paid In (EUR) ; Exchange Out; Exchange In; Balance (EUR); Category; Notes
Jan 9, 2019 ; Supermarkt am Marktplatz  ; 4.75 ;  ;  ;  ; 45.16; shopping; 
Jan 7, 2019 ; Bauhaus im Hausbau  ; 73.75 ;  ;  ;  ; 49.91; utilities; 
mpschr commented 5 years ago

I also did some debugging even the following line is failing and returning NaN

const paidOut = get(operation, 'Paid Out (EUR)')

I am glad to help you out debugging, but don't bother too much as I started to reimplmenet in python

glarivie commented 5 years ago

Thanks for your help, issue has been fixed here: https://github.com/hqro/revolut-csv-to-qif/commit/065093c8aff52b208f7b97f03305af7e85101be8

mpschr commented 5 years ago

Great, now the values are read correcltly.. What still looks unexpected to me are the empty P lines


!Type:Bank
D09/01/2019
T-4.75
P
^
D07/01/2019
T-73.75
P
^
glarivie commented 5 years ago

Fixed here: https://github.com/hqro/revolut-csv-to-qif/commit/cf5a8d6d507331b0ebc976e8d6917044ba0d570e