将完全引用的 csv 文件转换为 tsv 格式

convert a fully quoted csv file to tsv format

我有一个这样的文件:

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

并希望将逗号转换为制表符作为分隔符。

我试过了:

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

然而,看起来唯一的效果是将逗号更改为文字字符 t:

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

我的 sed 表达式有什么问题吗?

这是非 GNU 版本的 sed 的问题,如果可能,请使用 space 作为分隔符或粘贴制表符而不是 sed,或者使用 $(printf \t) 而不是 \t