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

Add ability to quote all output #297

Open
moorereason opened this issue Jan 11, 2025 · 1 comment
Open

Add ability to quote all output #297

moorereason opened this issue Jan 11, 2025 · 1 comment

Comments

@moorereason
Copy link
Contributor

The Problem

I need to be able to quote all headers and values in the output in order to maintain compatibility with another system. AFAIK, csvtk doesn't currently support his.

Reproduction

Given input file x.csv:

"A A","B","C","D"
"1","  2","3  ","4"

Given command:

csvtk sort x.csv

csvtk outputs:

A A,B,C,D
1,"  2",3  ,4

The desired output should be the same as the input file.

Workaround

I'm currently using miller as a workaround:

csvtk sort x.csv | mlr --csv --quote-all --no-color cat
@shenwei356
Copy link
Owner

Sorry, csv.Writer does not support that.

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

2 participants