Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with file in which every column is quoted. #58

Closed
cpaulik opened this issue Feb 21, 2016 · 5 comments
Closed

Problem with file in which every column is quoted. #58

cpaulik opened this issue Feb 21, 2016 · 5 comments

Comments

@cpaulik
Copy link

cpaulik commented Feb 21, 2016

I have a file with the following contents called test.csv. It is an example of what I get from my bank for credit card statements.

"30.03.2015";"29.03.2015";"09.04.2015";"BARAUSZAHLUNGSENTGELT";"5266 xxxx xxxx 9454";"";"0";"EUR";"0,00";"EUR";"-3,50";"0"

Trying to parse this with reckon using the command:

reckon -f test.csv --csv-separator ";" -p -v --comma-separates-cents

I get the following error:

/usr/lib/ruby/2.3.0/csv.rb:1883:in `block (2 levels) in shift': Illegal quoting in line 1. (CSV::MalformedCSVError)
    from /usr/lib/ruby/2.3.0/csv.rb:1845:in `each'
    from /usr/lib/ruby/2.3.0/csv.rb:1845:in `block in shift'
    from /usr/lib/ruby/2.3.0/csv.rb:1805:in `loop'
    from /usr/lib/ruby/2.3.0/csv.rb:1805:in `shift'
    from /usr/lib/ruby/2.3.0/csv.rb:1747:in `each'
    from /usr/lib/ruby/2.3.0/csv.rb:1761:in `to_a'
    from /usr/lib/ruby/2.3.0/csv.rb:1761:in `read'
    from /usr/lib/ruby/2.3.0/csv.rb:1307:in `parse'
    from /home/cp/.gem/ruby/2.3.0/gems/reckon-0.4.4/lib/reckon/csv_parser.rb:241:in `parse'
    from /home/cp/.gem/ruby/2.3.0/gems/reckon-0.4.4/lib/reckon/csv_parser.rb:11:in `initialize'
    from /home/cp/.gem/ruby/2.3.0/gems/reckon-0.4.4/lib/reckon/app.rb:18:in `new'
    from /home/cp/.gem/ruby/2.3.0/gems/reckon-0.4.4/lib/reckon/app.rb:18:in `initialize'
    from /home/cp/.gem/ruby/2.3.0/gems/reckon-0.4.4/bin/reckon:7:in `new'
    from /home/cp/.gem/ruby/2.3.0/gems/reckon-0.4.4/bin/reckon:7:in `<top (required)>'
    from /home/cp/.gem/ruby/2.3.0/bin/reckon:23:in `load'
    from /home/cp/.gem/ruby/2.3.0/bin/reckon:23:in `<main>'

It does work when I remove the quoting of the first column.

@cantino
Copy link
Owner

cantino commented May 25, 2016

Hey @cpaulik, you may need to add a new option for skipping quotes around entries. What do you mean about removing the quoting on the first column?

@cpaulik
Copy link
Author

cpaulik commented May 25, 2016

What I meant with unquoting the first column is to change the line in the csv to start with:

30.03.2015;"29.03.2015"...

Which new option do you mean?

@cantino
Copy link
Owner

cantino commented Sep 24, 2016

Sorry for the delay. I meant that you'd have to add functionality to Reckon to identify columns surrounded by quotes and to remove them.

benprew added a commit that referenced this issue Jan 31, 2020
@benprew
Copy link
Collaborator

benprew commented Jan 31, 2020

@cpaulik This is fixed in #78. Once it's available in the gem, I'll close this ticket.

Thanks for using reckon!

@benprew
Copy link
Collaborator

benprew commented Feb 5, 2020

#78 has been merged to master, closing this ticket.

@benprew benprew closed this as completed Feb 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants