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

parsecsv can't handle empty lines at the beginning of the file #8365

Closed
akbcode opened this issue Jul 19, 2018 · 1 comment

Comments

Projects
None yet
3 participants
@akbcode
Copy link

commented Jul 19, 2018

import parsecsv, streams

let content = newStringStream("\nOne,Two,Three,Four\n1,2,3,4\n10,20,30,40,\n100,200,300,400\n")

var p: CsvParser
p.open(content, "test.csv")
p.readHeaderRow()
while p.readRow():
    echo p.rowEntry("One")
    echo p.rowEntry("Two")
    echo p.rowEntry("Three")
    echo p.rowEntry("Four")
p.close()

This produces a segfault. It works if the preceding \n is removed.

@dom96 dom96 added the Stdlib label Jul 19, 2018

FedericoCeratto added a commit to FedericoCeratto/Nim that referenced this issue Oct 12, 2018

FedericoCeratto added a commit to FedericoCeratto/Nim that referenced this issue Oct 12, 2018

@timotheecour

This comment has been minimized.

Copy link
Contributor

commented Oct 13, 2018

@akbcode tip use nim instead of to syntax highlight as nim (EDIT: did it for you)

FedericoCeratto added a commit to FedericoCeratto/Nim that referenced this issue Jan 25, 2019

@Araq Araq closed this in #9343 Jan 26, 2019

Araq added a commit that referenced this issue Jan 26, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.