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

CsvWriterSettings - add option to not create the final line separator #530

Open
ghillert opened this issue Feb 3, 2024 · 0 comments
Open

Comments

@ghillert
Copy link

ghillert commented Feb 3, 2024

In Common Format and MIME Type for Comma-Separated Values (CSV) Files it is stated:

The last record in the file may or may not have an ending line break..

Google Sheets that are exported as CSV, do not contain a trailing line break. Also, Google Sheets are exported in a "Windows format" and I need to set setLineSeparator("\r\n") in CsvWriterSettings to create a matching CSV file.

When writing CSV files with univocity, I was trying to recreate the Google Sheets format exactly (to be able to diff CSV files). This does not seem to be (easily) possible right now. I can get somewhat close by setting setNormalizedNewline('\n'), which will not create the last line but it will still create the carriage return character.

Would it be possible to have an option on CsvWriterSettings to set something like setEndingLineSeparator(false)?

This issue may be related to #388

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant