Originally posted by terse at 2008-4-24 04:40 PM:
@echo off&setlocal enabledelayedexpansion
set /P str1=输入替换前字符:
SET /P STR2=输入替换后字符:
for /f "delims=" %%i in (test.txt) do (
set str=%%i
set st ...
@echo off&setlocal enabledelayedexpansion
for /f "delims=" %%i in (test.txt) do (
set str=%%i
set str=!str:9] 公 告=11] 公 告!
echo !str!>>test1.txt
)
pause
Originally posted by yhshiro at 2008-4-24 17:29:
里面的 那个数字 我要随机1~12的,不要我指定的!.......
@echo off&setlocal enabledelayedexpansion
set/a n=%random%%%12+1
for /f "delims=" %%i in (test.txt) do (
set str=%%i
set str=!str:9] 公 告=%n%] 公 告!
echo !str!>>test1.txt
)
pause