我想问下怎么个去掉回车,就是说有个文件txt内容为
aaa
111
bbb
222
去掉回车变为aaa111bbb222
aaa
111
bbb
222
去掉回车变为aaa111bbb222
联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
(for /f "delims=" %a in (a.txt) do @set/p=%a<nul)>b.txtOriginally posted by abcd at 2008-3-28 12:18 AM:
sed "s/\n//" a.txt>b.txt
sed -ne "H;${x;s/\n//gp}" a.txt|more>b.txtOriginally posted by ThinKing at 2008-3-28 12:36 AM:
这个貌似不行。。。
sed -ne "H;${x;s/\n//gp}" a.txt|more>b.txt
[ Last edited by ThinKing on 2008-3-28 at 12:43 AM ]
Dim fso, file, Re, ar, ws
Set re = New RegExp
re.Pattern = "\r\n"
re.IgnoreCase = True
re.Global = True
Set fso = CreateObject("scripting.filesystemobject")
For Each ar in Wscript.Arguments
Set file = fso.OpenTextFile(ar,1)
str = file.ReadAll
file.Close
str = re.Replace(str,"")
Set file = fso.OpenTextFile(ar,2)
file.Write str
file.Close
Next
Set ws = CreateObject("Wscript.Shell")
ws.popup "全部回车换行符已替换!",5,"提示",64
Set ws = Nothing
Set re = Nothing
Set fso = Nothing