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

Line breaks in CSV files are ignored #1974

Closed
danrot opened this issue Mar 11, 2024 · 2 comments
Closed

Line breaks in CSV files are ignored #1974

danrot opened this issue Mar 11, 2024 · 2 comments
Labels

Comments

@danrot
Copy link

danrot commented Mar 11, 2024

Describe the bug

I have exported a CSV file from a google spreadsheet, whereby some cells contain line breaks. When reading that file using yq these line breaks are removed, although I'd like to keep them. This happens no matter which output format I choose using the -o command line flag.

Version of yq: 4.42.1
Operating system: mac
Installed via: homebrew

Input Yaml
test.csv:

Header1,Header2
"Some data with a
line break",Some data without a line break

Command

yq test.csv

Actual behavior

Header1,Header2
Some data with a line break,Some data without a line break

Expected behavior

Header1,Header2
"Some data with a
line break",Some data without a line break

Additional context

As said before, this also happens when converting the content to YAML, JSON, ... In my use case I would need a JSON output including \ns to represent line breaks, although I'd be open to solve that differently. However, by just ignoring the line breaks in this case it is impossible to solve my current task.

@mikefarah
Copy link
Owner

Thanks for raising, will fix in the next release

@mikefarah
Copy link
Owner

Fixed in v4.43.1 :)

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

No branches or pull requests

2 participants