dickwolff / Export-To-Ghostfolio

Convert transaction history export from your favorite broker to a format that can be imported in Ghostfolio.
https://hub.docker.com/r/dickwolff/export-to-ghostfolio
Apache License 2.0
45 stars 8 forks source link

Got a parsing error #79

Closed TiagoVilasBoas10 closed 3 months ago

TiagoVilasBoas10 commented 3 months ago

export-to-ghostfolio@1.0.0 watch tsx ./src/watcher.ts

[i] Purging cache (PURGE_CACHE set to true).. [i] Watching /var/tmp/e2g-input (using polling).. [i] Cache purged! [i] Found Transactions(1).csv! [i] Determined the file type to be of kind 'degiro'. [i] Found xStation5_cashOperations_2770548_31-12-2006--29-05-2024.csv! [i] Determined the file type to be of kind 'xtb'. [i] Restored 0 ISIN-symbol pairs and 0 symbols from cache.. [i] Processing file using DeGiro converter [i] Restored 0 ISIN-symbol pairs and 0 symbols from cache.. [i] Processing file using XTB converter [e] An error ocurred while processing. [e] Error details: Error: An error ocurred while parsing! [e] Moving file to output.. [i] Read CSV file. Start processing.. /app/src/converters/xtbConverter.ts:112 const quantity = parseFloat(match[1]); ^

TypeError: Cannot read properties of null (reading '1') at (/app/src/converters/xtbConverter.ts:112:45) at Parser. (file:///app/node_modules/csv-parse/lib/index.js:102:7) at Parser.emit (node:events:519:28) at Parser.emit (node:domain:488:12) at endReadableNT (node:internal/streams/readable:1696:12) at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

Node.js v20.13.1

Example File xStation5_cashOperations_2770548_31-12-2006--29-05-2024.csv

dickwolff commented 3 months ago

Thanks for reporting! I think there is an issue with the example file you provided. When I click it, I get a "Not found". Could you try and upload it again?

image

TiagoVilasBoas10 commented 3 months ago

Hello dickwolff, please find attached a sample file exported from xstation5 (XTB).

xStation5_cashOperations_2770548_31-12-2006--29-05-2024(3).csv

Best regards, TVB

dickwolff commented 3 months ago

Incan download the CSV file now, thanks! I will check it out tomorrow and see if I can find the problem. I will get back to you once I know more!

dickwolff commented 3 months ago

The root cause of the issue was buy/sell orders not being recognized due to language difference. I assumed it was Spanish (compra for "buy"), and also added vende for "sale". Please let me know if this is the right term to use!

I added a fix to the 0.14.0-beta image, which you can pull from Docker Hub. Please let me know if this resolves the parsing issue!

TiagoVilasBoas10 commented 3 months ago

Tested and working. "vende" and "compra" are the right words. It is Portuguese.

dickwolff commented 3 months ago

Cool, thanks for confirming!

I will merge the changes to main together with #80