小编use*_*099的帖子

使用sed仅打印每个段落的第一个单词

我想知道如何用sed one-liner打印每个段落的第一个单词.本例中的段落由2个换行符后面的文本定义.

例如

This is a paragraph with some text. Some random text that is not really important.

This is another paragraph with some text.
However this sentence is still in the same paragraph.
Run Code Online (Sandbox Code Playgroud)

这应该转化为

This

This
Run Code Online (Sandbox Code Playgroud)

sed

5
推荐指数
2
解决办法
1020
查看次数

标签 统计

sed ×1