Skip to content

csv import: 4 rule file accepts a record of only 3 fields #1803

Description

@agander

If you're not sure this is a bug, or if some discussion would help,
**
Brief chat on hledger.irc Jan 7th 16:08-16:56
**

Have you looked at (the right version of) the user manual?
Yes

A small reproducible example (--anon can help anonymise data)

I created my CSV data file and inadvertently missed a ',' after the payee name in record 2.
CSV data:

2021-12-22,garo_bike ;  ebici,expenses:trasporto:ebici,-50.0
2021-12-23,caffe_siciliaexpenses:cibo:dolce,-10.5
2021-12-27,simone ; pane:simone,expenses:cibo:pane,-4.8

RULES file:

account1 assets:bank:checking
fields date, description, account2, amount

CMD and result:

I then did a --dry-run:
An noticed the strange output in the 2nd posting

$ hledger import --dry-run --rules-file=./inc_exp2018_ods.csv.rules csv_missing_delim.csv
; would import 3 new transactions from csv_missing_delim.csv:

2021-12-22 garo_bike ;  ebici
    assets:bank:checking               -50.0
    expenses:trasporto:ebici            50.0

2021-12-23 caffe_siciliaexpenses:cibo:dolce
    assets:bank:checking              %4
    -10.5                            %-4

2021-12-27 simone ; pane:simone
    assets:bank:checking            -4.8
    expenses:cibo:pane               4.8

The output of hledger --version
1.24, linux-x86_64

What platform you're on
Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-BUGSomething wrong, confusing or sub-standard in the software, docs, or user experience.csvThe csv file format, csv output format, or generally CSV-related.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions