【发布时间】:2013-04-18 16:10:21
【问题描述】:
我尝试重新组织包含以下内容的文件的格式:
>Humanl|chr16:86430087-86430726 | element 1 | positive
>Humanl|chr16:85620095-85621736 | element 2 | negative
>Humanl|chr16:80423343-80424652 | element 3 | negative
>Humanl|chr16:80372593-80373755 | element 4 | positive
>Humanl|chr16:79969907-79971297 | element 5 | negative
>Humanl|chr16:79949950-79951518 | element 6 | negative
>Humanl|chr16:79026563-79028162 | element 7 | negative
>Humanl|chr16:78933253-78934686 | element 9 | negative
>Humanl|chr16:78832182-78833595 | element 10 | negative
我的命令是:
awk '{FS="|";OFS="\t"} {print $1,$2,$3,$4,$5}'
这是输出:
>Human|chr16:86430087-86430726 | element 1 |
>Human chr16:85620095-85621736 element 2 negative
>Human chr16:80423343-80424652 element 3 negative
>Human chr16:80372593-80373755 element 4 positive
>Human chr16:79969907-79971297 element 5 negative
>Human chr16:79949950-79951518 element 6 negative
>Human chr16:79026563-79028162 element 7 negative
>Human chr16:78933253-78934686 element 9 negative
>Human chr16:78832182-78833595 element 10 negative
除第一行外,每一行都可以正常工作。我不明白为什么会这样。
有人可以帮我吗?谢谢!
【问题讨论】:
-
您已经有了答案,但请考虑将来的问题,包括示例输入、当前和预期的文本输出。
-
好的,以后会做帽子的。