
CODE: [Copy to clipboard]说明:test.txt为你要处理的文件。@echo off & setlocal enabledelayedexpansion
set /a num=0
for /f %%i in ('type test.txt') do (
set/a num+=1
if !num! EQU 1 (echo %%i;>test.txt) else echo %%i;>>test.txt)
pause>nul
CODE: [Copy to clipboard]sed "s/.*/&;/" urfile
CODE: [Copy to clipboard]sed "1s/.*/&;/;2,$s/.*/&;/" urfile
CODE: [Copy to clipboard][ Last edited by ieutk on 2007-5-28 at 10:54 PM ]@echo off & setlocal enabledelayedexpansion
set /a num=0
set test=
if exist test-a.txt del /q /f test-a.txt
for /f "delims=" %%i in (test.txt) do (
set/a num+=1
set test=%%i
echo !test!;>>test-a.txt
)
| Quote: | |
|
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |