根据你贴出来的数据做的。- @echo off &setlocal enabledelayedexpansion
- ::请使用前下载conset.exe,放在和本文件同目录下或系统目录下
- ::下载地址:http://www.bathome.net/viewthread.php?tid=12865&highlight=%B8%A1%B5%E3
- for %%a in (cool MAIL) do ^
- for /f "delims=: tokens=1" %%b in ('findstr /x /i /n "%%a" a.txt') do set/a #+=1&set #!#!=%%b
- >new.txt (for /f "skip=%#1% eol=C tokens=*" %%b in (a.txt) do echo %%b)
- for /f "tokens=*" %%c in (new.txt) do ^
- for %%d in (%%c) do if not "%%d" equ "MAIL" (set/a a+=1&set #!_!!a!=%%d) else (set a=0&set _=#)
- >last.txt (for /f "tokens=*" %%c in (2.txt) do ^
- for %%d in (%%c) do conset /a !#%%d!*!##%%d!&echo,)
复制代码
|