【发布时间】:2017-01-13 22:45:14
【问题描述】:
我有一个大的标记句子文件。不同的句子由空行隔开。输入文件基本上只是一大列。
我想转置单列,使每个唯一的句子都有自己的行。
输入:
Sentence1
Sentence1
Sentence1
Sentence1
Sentence2
Sentence2
Sentence2
...
SentenceN
期望的输出是这样的:
Sentence1 Sentence1 Sentence1 Sentence1
Sentence2 Sentence2 Sentence2
...
我一直在寻找 grep、awk、sed 和 tr,但我正在努力使用正确的语法。
谢谢!
【问题讨论】:
标签: unix text-processing