aniav / ynab-csv

Tool for making your CSV files ready to import into YNAB
https://aniav.github.io/ynab-csv/
MIT License
162 stars 85 forks source link

Info lines before column headers should be ignored #5

Closed laszlopandy closed 4 years ago

laszlopandy commented 6 years ago

For some reason, by bank decided it is a good idea to put a title, and date range information on the first three lines before the column headers appear. This is clearly non-standard, and makes the ynab-csv converter believe that there is only one column.

Számlatörténet
Időszak: 2018.02.28-2018.03.31
Információ időpontja: 2018.03.31 09:57
Számla;Megbízás típusa;Összeg;Devizanem;Eredeti összeg;Ellenoldali számla tulajdonosa;Ellenoldali számla száma;Megbízó bankja;Közlemény;Értéknap;Kártya;Költségviselés módja;Bank költség1;Bank költség2;Bank költség3;Bank költség4;Bank költség5;Kiegészítő információ;Megbízás azonosítója;SWIFT referenciaszám;Tranzakció helye;Könyvelési dátum
10100716-xxxxxxxx-xxxxxxxx;Átvezetés;40000;HUF;40 000 HUF;;;;;2018.03.29.;;;;;;;;"DÍJ VISSZAFIZ";hx454gf2433;;Kozpont;2018.03.29.

Perhaps the heuristic should be: when searching for the column headers, ignore lines that appear to only have one column. If I try sending a PR if I have some time later.

aniav commented 6 years ago

I have seen other banks also add a few empty lines for some reasons at the beginning so maybe a better approach would be to allow the option of selecting the number of rows to skip?

rolbr commented 5 years ago

@aniav maybe don't stop there but actually enable a range of rows to be selected for input, e.g. "rows 3-27".

My bank will export some intro rows (CHECKING account) similar to @laszlopandy 's example, then list the individual transactions in proper CSV format, followed by some blank lines, then another set of intro rows for a second account (SAVINGS), then transactions for my second account, again some intro rows for the third account (VISA) followed by the transactions of that third account.

I have no option to export individual CSVs for each account so I have to split that contraption manually. Being able to define a range of lines to be the source data for conversion would help tremendously.

aniav commented 5 years ago

Agreed on that proposal! I don't expect to have time to do anything around that in the next weeks. Happy to accept anyone doing that change though! 🙏

aniav commented 4 years ago

This is now fixed. You can choose at which row to start:

Screenshot 2020-03-29 at 11 47 12