cassava icon indicating copy to clipboard operation
cassava copied to clipboard

Parse failure when CSV has trailing newline

Open begriffs opened this issue 9 years ago • 6 comments

As reported in https://github.com/begriffs/postgrest/issues/691

Lots of tools that generate CSV files add a trailing newline, so this behavior tends to be frustrating. I can work around it by using head -c -1, but it'd be nice if I could just curl a CSV file without having to worry about it.

Would you be interested in me attempting to create a cassava pull request for this?


As a side note I started to look into making a pull request but had a problem running the tests. I cloned the project, was able to do stack init and stack build to build it, but stack test doesn't seem to run the test suite:

$ stack test
cassava-0.4.5.0: test (suite: unit-tests)

Either it's not running the tests or just not displaying the details of the test run. I see that the unit tests binary is created in ./.stack-work/dist/x86_64-osx/Cabal-1.24.0.0/build/unit-tests/unit-tests and when run directly it lists the passing tests. Not sure what's wrong with stack.

begriffs avatar Aug 10 '16 05:08 begriffs

(bump)

begriffs avatar Aug 26 '16 21:08 begriffs

Have you had a chance to look into this issue?

begriffs avatar Oct 03 '16 22:10 begriffs

@hvr is this library still maintained?

begriffs avatar Jan 25 '17 07:01 begriffs

@begriffs: @hvr has just merged a few PRs, so he'd probably be happy to accept one that fixes this issue.

ivan-m avatar Jun 16 '17 05:06 ivan-m

Is this about corrupted/invalid CSV files being terminated by \r\n\n instead of \r\n?

hvr avatar Jun 16 '17 11:06 hvr

No, it's not about mixing of \r and \n, just about a file ending in \n\n aka a blank line at the end. Technically that line is wrong because it doesn't have the right number of columns, but would be nice to ignore that incorrectness since some programs output files that way.

begriffs avatar Jul 02 '17 04:07 begriffs