hoffie / dkb-visa

DKB transaction download and conversion (CSV, QIF)
GNU Affero General Public License v3.0
56 stars 26 forks source link

html included in csv file #8

Open inktrap opened 8 years ago

inktrap commented 8 years ago

Note that sometimes the original csv-file includes information, formatted via html. I solved it like this:

    # check that unparseable lines are not included as transactions
    # dkb should really fix their csv export, they should have the
    # money for that, right?
    csv_text = csv_text.splitlines()
    csv_text_filtered = []
    for line in csv_text:
        if "<br />" in line:
            continue
        else:
            csv_text_filtered.append(line)
    csv_text = "\n".join(csv_text_filtered)

This will exclude transactions that have <br /> in their description.