我想知道如何僅使用sed單行程打印每個段落的第一個單詞。在這種情況下,段落由緊跟2個換行符的文本定義。僅使用sed打印每個段落的第一個詞
例如
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.
這應該轉化爲
This
This
只是一個側面說明,如果你想將記錄分隔符被_exactly_打斷倆行,用'RS =「\ n \ n」'爲'awk'。不記得如何在cmd行的'perl'中執行它。也許其他人會知道嗎? – Steve 2013-05-05 15:13:10
這麼簡單,那麼清楚.... +1當然。 – 2013-05-06 00:34:47