BurntSushi / xsv

A fast CSV command line toolkit written in Rust.
The Unlicense
10.23k stars 317 forks source link

How to avoid extra quotes #313

Closed lamyergeier closed 1 year ago

lamyergeier commented 1 year ago

I read that

$ xsv fmt -h
    --escape <arg>             The escape character to use. When not specified,
                               quotes are escaped by doubling them.

In the following I don't want any escape characters and I don't want quotes to double. I want it to print as it is!


TSV file:

$ \cat ~/Desktop/Temp/Test.tsv 
Function        Command
Install dSourceP="${HOME}/Log"
Install sudo apt-get install -y build-essential
$ xsv select "Command" ~/Desktop/Temp/Test.tsv  --delimiter $'\t' | xsv fmt -t $'\t' 
Command
"dSourceP=""${HOME}/Log"""
sudo apt-get install -y build-essential

Issue

In line 1 of output we see multiple double quotes added at several places. How can I avoid this?

Expected Output

$ xsv select "Command" ~/Desktop/Temp/Test.tsv  --delimiter $'\t' | xsv fmt -t $'\t' 
Command
dSourceP="${HOME}/Log"
sudo apt-get install -y build-essential
BurntSushi commented 1 year ago

You can't. That output isn't valid CSV.