Qiang Xu
Qiang Xu

Reputation: 4803

convert a fully quoted csv file to tsv format

I have a file like:

"a","b","c"...

And want to convert the comma to tab for the delimiter.

I tried:

sed -e 's/","/"\t"/g' < input_file > output_file

Yet, it looks the only effect is to change the comma to the literal character t:

"a"t"b"t"c"...

Anything wrong with my sed expression?

Upvotes: 0

Views: 161

Answers (1)

Rozuur
Rozuur

Reputation: 4165

This is a problem with non GNU versions of sed, if possible use space as delimier or paste tab instead of sed, or use $(printf \t) instead of \t

Upvotes: 2

Related Questions