make a batch file called changelines.cmd @echo off echo. for /f "tokens=1* delims= " %%a in (%1) do ( if %%a==^<?xml echo. 2>%temp% ewfile.tmp if %%a==^ >>%temp% ewfile.tmp if not %%a==^<?xml if not %%a==^<scenarioFile echo %%a%%b >>%temp% ewfile.tmp ) copy /y %temp% ewfile.tmp %1 > nul del %temp% ewfile.tmp
now you can run this from the command prompt: for %a in (*.ext) do changelines %a
replace *.ext with the wildcard of your excel files
make a batch file called changelines.cmd @echo off echo. for /f "tokens=1* delims= " %%a in (%1) do ( if %%a==^<?xml echo. 2>%temp% ewfile.tmp if %%a==^ >>%temp% ewfile.tmp if not %%a==^<?xml if not %%a==^<scenarioFile echo %%a%%b >>%temp% ewfile.tmp ) copy /y %temp% ewfile.tmp %1 del %temp% ewfile.tmp
now from the command line, do this: for %a in (*.ext) do changelines %a
replace *.ext with the filename and type of your excel files.
make a batch file called changelines.cmd @echo off echo. for /f "tokens=1* delims= " %%a in (%1) do ( if %%a==^<?xml echo. 2>%temp% ewfile.tmp if %%a==^ >>%temp% ewfile.tmp if not %%a==^<?xml if not %%a==^<scenarioFile echo %%a%%b >>%temp% ewfile.tmp ) copy /y %temp% ewfile.tmp %1 del %temp% ewfile.tmp
now from the command line, do this: for %a in (*.ext) do changelines %a
replace *.ext with the filename and type of your excel files.
Comments
@echo off
echo.
for /f "tokens=1* delims= " %%a in (%1) do (
if %%a==^<?xml echo. 2>%temp%
ewfile.tmp
if %%a==^ >>%temp%
ewfile.tmp
if not %%a==^<?xml if not %%a==^<scenarioFile echo %%a%%b >>%temp%
ewfile.tmp
)
copy /y %temp%
ewfile.tmp %1 > nul
del %temp%
ewfile.tmp
now you can run this from the command prompt:
for %a in (*.ext) do changelines %a
replace *.ext with the wildcard of your excel files
@echo off
echo.
for /f "tokens=1* delims= " %%a in (%1) do (
if %%a==^<?xml echo. 2>%temp%
ewfile.tmp
if %%a==^ >>%temp%
ewfile.tmp
if not %%a==^<?xml if not %%a==^<scenarioFile echo %%a%%b >>%temp%
ewfile.tmp
)
copy /y %temp%
ewfile.tmp %1
del %temp%
ewfile.tmp
now from the command line, do this:
for %a in (*.ext) do changelines %a
replace *.ext with the filename and type of your excel files.
@echo off
echo.
for /f "tokens=1* delims= " %%a in (%1) do (
if %%a==^<?xml echo. 2>%temp%
ewfile.tmp
if %%a==^ >>%temp%
ewfile.tmp
if not %%a==^<?xml if not %%a==^<scenarioFile echo %%a%%b >>%temp%
ewfile.tmp
)
copy /y %temp%
ewfile.tmp %1
del %temp%
ewfile.tmp
now from the command line, do this:
for %a in (*.ext) do changelines %a
replace *.ext with the filename and type of your excel files.