- @echo off
- setlocal enabledelayedexpansion
- set /a k=1000,m=2000,n=3000
- for /f "tokens=1* delims=|" %%a in (a.txt) do (
- if !k!==1000 set "#!k!=#[MARK]"&set "#!m!=#[COMMENT]"&set "#!n!=#[color]"
- set /a k+=1,m+=1,n+=1
- set "#!k!=#%%a=666"&set "#!m!=#%%a=%%b"&set "#!n!=#%%a=66FFFF"
- )
- set /a k+=1,m+=1,n+=1
- set "#!k!=#"&set "#!m!=#"&set "#!n!=#"
- (for /f "tokens=1* delims=#" %%i in ('set #') do echo,%%j)>#a.txt
- pause
复制代码
|