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
Closed

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

akbcode opened this issue Jul 19, 2018 · 1 comment

Comments

@akbcode
Copy link

akbcode 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.

FedericoCeratto pushed a commit to FedericoCeratto/Nim that referenced this issue Oct 12, 2018
FedericoCeratto pushed a commit to FedericoCeratto/Nim that referenced this issue Oct 12, 2018
@timotheecour
Copy link
Member

timotheecour commented Oct 13, 2018

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

FedericoCeratto pushed a commit to FedericoCeratto/Nim that referenced this issue Jan 25, 2019
ThomasTJdev pushed a commit to ThomasTJdev/Nim that referenced this issue Jan 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants