联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
@echo off & setlocal EnableDelayedExpansion for /f "tokens=1*" %%a in ('findstr "^newStreetAddress" a.txt') do ( set /a n+=1 set !n!a=%%b ) for /f "tokens=1*" %%a in ('findstr "^newState" a.txt') do ( set /a o+=1 set !o!b=%%b ) for /f "tokens=1*" %%a in ('findstr "^newNumber" a.txt') do ( set /a p+=1 set !p!c=%%b ) for /f "tokens=1*" %%a in ('findstr "^Zip" a.txt') do ( set /a q+=1 set !q!d=%%b ) for /l %%c in (1,1,%n%) do echo !%%ca! !%%cb! !%%cc! !%%cd!>>extract.txt
@echo off for /f "tokens=1*" %%i in ('findstr "^newStreetAddress ^newState ^newNumber ^Zip" a.txt') do echo>>new.txt %%j start new.txt