foxidrive wrote:Ben Mar wrote:I don't know why the output is not working properly in the original post. Here is the new fixed:Code: Select all
@echo off
setlocal EnableDelayedExpansion
for /f "tokens=1,*" %%A in (long_url.txt) do (
echo %%A>url.lst
if "%%B"=="" goto :eof
set nextURL=%%B
:Begin
for /f "tokens=1,*" %%F in ("!nextURL!") do (
echo %%F>>url.lst
if "%%F"=="" goto :eof
set nextURL=%%G
goto Begin
)
)
type url.lst
To use your technique, this is all that's needed.Code: Select all
@echo off
del url.txt 2>nul
:begin
for /f "tokens=1,*" %%A in (long_url.txt) do (
echo %%A>>url.lst
if not "%%B"=="" echo %%B>long_url.txt & goto :begin
)
type url.lst
pause
Thanks for the simplication method.