【发布时间】:2014-05-27 06:59:27
【问题描述】:
我有一个 ascii 文件,内容如下:
START
this is my home
this is my pc
START
this is my linux
this is my awk
this is nice
START
this is a single line
START
this is my work
this is the end
this line has to be read
START
...
...
START
.
.
.
.
我想读取 START 和空白行之间的行并以分隔格式打印输出。 输出应为以下格式:
this is my home;this is my pc
this is my linux;this is my awk;this is nice
this is a single line
this is my work;this is the end;this line has to be read
我使用分号作为分隔符。 请注意:START 和 Blank 行之间的行数不固定。
我尝试过使用 awk,但在 START 之后我只能读取一行
awk 'BEGIN { RS = "START" } ; { print $1 }'
谁能引导我到正确的论坛/正确的方向...
谢谢
【问题讨论】: