
CODE: [Copy to clipboard]sed:gawk "{if($1~/^\\/){printf \" \"$0}else{if(NR>1){printf \"\n\"$0}else{printf $0}}}" test.txt
CODE: [Copy to clipboard]bat:sed -n "H;${x;s/\n\\/ \\/gp;}" test.txt
CODE: [Copy to clipboard][ Last edited by lxmxn on 2007-10-25 at 02:20 AM ]@echo off & SetLocal EnableDelayedExpansion
for /f "delims=" %%a in (test.txt) do (
set str=%%a
if "!str:~0,1!"=="+" (
if not defined lxmxn (set lxmxn=batcher) else echo.
set/p=%%a<nul
)
if "!str:~0,1!"=="\" set/p= %%a<nul
)
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |