
CODE: [Copy to clipboard]@echo off
setlocal disabledelayedexpansion
set 文本="g:\我的文档\桌面\a.txt"
set "旧=:"
set "新=冒号"
:: 旧字串和新字串不能含有英文感叹号 !
(for /f "eol= delims=" %%a in ('findstr /n .* %文本%') do (
set var=%%a
setlocal enabledelayedexpansion
if "!var:*:=!"=="" (echo;) else (
set var=!var:*:=!
echo;!var:%旧%=%新%!
)
endlocal
))>"%temp%\txt_new"
move "%temp%\txt_new" %文本%
CODE: [Copy to clipboard][ Last edited by yishanju on 2009-6-20 at 20:20 ]fr -f:":" -t:"xxx" a.txt
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |