本帖最后由 tmplinshi 于 2013-1-3 11:05 编辑
- @echo off
- setlocal enabledelayedexpansion
-
- set file="file A.txt"
-
- for /f "tokens=*" %%a in (' more %file% ') do (
-
- set str=%%a
-
- for %%i in (SUP Number Location) do (
- set str=!str:*%%i=%%i!
- set str=!str: =!
-
- if "!str:%%i:=!" neq "!str!" (
- set %%i=!str:*:=!
- )
- )
-
- )
-
- ren %file% %SUP%_%Number%_%Location%.txt
复制代码
|