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
Carriage returns replaced with unix line-endings mid-field #606
Comments
Do you have a sample CSV I can test with? |
input: cut_test.csv If you see the output, the field content has been changed with respect to CR. |
Using latest agate, |
Yeah this is weird. Ticketing upstream. |
So I checked up the upstream code. Here is the relevant section:
The short answer is this was done intentionally. I can't recall exactly the logic that led to it, but I do recall it was a compromise for a thorny issue that I don't particularly want to revisit. Turning (Side note: That original test file has super-weird quoting, and also doesn't open correctly in Excel.) |
Sounds fair to me. |
Closing this since there has been no disagreement. |
@onyxfish and @jpmckinney @onyxfish said:
RFC 4180 says CSV files should use \r\n (crlf) for the end of line. And some tools, at least CSVLint, strictly follow the RFC. For example: https://csvlint.io/validation/589e284f613562000400000f I understand that the RFC is not a standard but why convert (crlf) to (lf) if the user made the choice of (crlf) at first? At least I could understand that csvclean doesn't convert (lf) to (crlf) nor (any-type-of-end-of-line) to (any-type-of-end-of-line). I'm currently writing a document for thousands of futur Open Data producers in France (a new law made Open Data mandatory for public bodies with 3,500+ people). [Document is in french but I can publish a draft here.] I would like to promote csvkit but it's hard to do so until files produced by csvkit get a warning in CSVLint. These people doesn't have big skills with data and command line tools (and english): it has to be very simple. At least it should be clearly documented. But I think it is better to be solved. |
@CharlesNepote This issue is about a situation like:
Where the |
Remove unneeded space in "agate.table.pivot.pivot()" docstring
Hi
I am using csvclean and csvcut tools, while using these tools the "Carriage Return" is removing from the field content, the CR should carry to the output file. Is there any way to retain these special character in the outputfile?
The text was updated successfully, but these errors were encountered: