我有file1
:
MSTRG.10807.1 0.494311896511595 MID 0.423993026403461 2.39379412548345 1.99703339651136
MSTRG.10884.1 0.365770947942799 EARLY 1.46416917664929 1.16816186543633 0.689075392478972
MSTRG.10958.1 0.52855355823638 MID 0.885493751836316 2.28463841550375 1.26867555157512
我使用了命令sed 's/ /,/g' file1 > file2
,这产生了file2
:
MSTRG.10807.1,,,0.494311896511595,,,MID,,,,0.423993026403461,,2.39379412548345,,,1.99703339651136
MSTRG.10884.1,,,0.365770947942799,,,EARLY,,1.46416917664929,,,1.16816186543633,,,0.689075392478972
MSTRG.10958.1,,,0.52855355823638,,,,MID,,,,0.885493751836316,,2.28463841550375,,,1.26867555157512
但我想要一个制表符分隔的文件。
使用
tr
:如果您想要制表符,请
\t
用作替换模式而不是,
.如果您只想用一个制表符(或逗号)替换多个空格,请在空格
\+
后添加: