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

Fails to parse last line of CSV if it isn't terminated with a new line #10

Open
GoogleCodeExporter opened this issue Mar 19, 2016 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. Create a CSV that doesn't have a new line at the bottom
2. Attempt to parse
3. Notice that the last column of the last row isn't read

What is the expected output? What do you see instead?
Each and every row/column correctly parsed.

What version of the product are you using? On what operating system?
Windows 7 Professional 64 bit

Please provide any additional information below.
This can be fixed via the attached patch. Essentially, when the last line is 
read (EOF character is detected), the code should increment current position, 
as we then allocate a buffer based on the line length, and as later code 
expects there to be a line terminator, we add the line terminator in in the 
second from last character (last character is NULL terminator, second from last 
EOL and previous characters are read from file).

Original issue reported on code.google.com by [email protected] on 24 Oct 2014 at 9:56

Attachments:

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

1 participant