|
发表于 2006-6-8 16:41:54
|
显示全部楼层
请seamonkey指教
那就先把空格去掉呵呵,这个应该可以,当然没有兄弟的写法tr -s '[:blank:]' '\n' < filename 简练,我也是为了练习一下
sed 's/[[:blank:]]\+/ /g' yue.txt |awk 'BEGIN{RS=" ";}{print $0}'
a.txt 如下:
this is a dog #单词之间有空格
you are welcome
[root@freedom ~]# sed 's/[[:blank:]]\+/ /g' yue.txt |awk 'BEGIN{RS=" ";}{print $0}'
this
is
a
dog
you
are
welcome
[root@freedom ~]#
但结果后面有许多空行,怎么回事?? 请seamonkey兄指教 |
|