日期:2014-05-17 浏览次数:20748 次
@echo off & setlocal enabledelayedexpansion set i=1 for /f %%a in (1.txt) do ( if !i!==1 (set installPath=%%a) else if !i!==2 (set fileName=%%a) else set installDirectory=%%a set /a i+=1 ) (for /f %%a in ('findstr /n .* 2.xml') do ( set line=%%a set line=!line:*:=! if "!line!"=="" (echo.) else ( set changed=!line:^<installPath^>=! if "!line!" neq "!changed!" (echo ^<installpath^>%installPath%^</installpath^>) else ( set changed=!line:^<fileName^>=! if "!line!" neq "!changed!" (echo ^<fileName^>%fileName%^</fileName^>) else ( set changed=!line:^<installDirectory^>=! if "!line!" neq "!changed!" (echo ^<installDirectory^>%installDirectory%^</installDirectory^>) else ( echo !line! ) ) )) ))>3.xml