f********o 发帖数: 1163 | 1 想把换行符替换成其他的符号,如何写?
我写过把其他符号替换成换行符;反过来竟然就不行…… |
c*******y 发帖数: 1630 | 2 http://stackoverflow.com/questions/1251999/sed-how-can-i-replac
【在 f********o 的大作中提到】 : 想把换行符替换成其他的符号,如何写? : 我写过把其他符号替换成换行符;反过来竟然就不行……
|
f********o 发帖数: 1163 | |
c*******y 发帖数: 1630 | 4 are you serious?
xxx@xxx:~$ cat txtfile
this
is
a
test
.
xxx@xxx:~$ sed ':a;N;$!ba;s/\n/ /g' txtfile
this is a test .
xxx@xxx:~$
【在 f********o 的大作中提到】 : 这些我都试过了,没有一个管用的。。。。
|
f********o 发帖数: 1163 | 5 ba: Event not found.
【在 c*******y 的大作中提到】 : are you serious? : xxx@xxx:~$ cat txtfile : this : is : a : test : . : xxx@xxx:~$ sed ':a;N;$!ba;s/\n/ /g' txtfile : this is a test . : xxx@xxx:~$
|
c*******y 发帖数: 1630 | 6 嗯,你说的对。linux版上回复你的是对的。
【在 f********o 的大作中提到】 : ba: Event not found.
|