Name: skakkola Date: October 16, 2007 at 03:20:30 Pacific Subject: Batch parse help OS: win xp CPU/Ram: 512 Model/Manufacturer: intel
Comment:
Hello, I have a txt file:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> <HTML> <HEAD> <TITLE>FTP Listing of /xx/xxx/xxx/xx/ at xxx.xxx.xxx</TITLE> <BASE HREF="ftp://xxx/wxx/xxx/xxx/xx/"> </HEAD> <BODY> <H2>FTP Listing of /xx/xxxx/xxx/xx/ at xxxx.xxx.xxx</H2> <HR> Parent Directory
for /f "tokens=* delims= " %%a in (ziplist) do ( if not !N!'==' goto :eof echo %%a | find "zip" > nul if not errorlevel 1 ( set str=%%a set str=!str:~-6! set N=!str:~0,2! ) echo number of the first zip is !N! )
===================================== If at first you don't succeed, you're about average.
for /f "tokens=* delims= " %%a in ('find "zip" ^< my.txt') do ( if not !N!'==' goto :eof set str=%%a set str=!str:~-6! set N=!str:~0,2! echo number of the first zip is !N! )
===================================== If at first you don't succeed, you're about average.
That's good, thakx, but I need to use it IN another script, so that the set 'setLocal EnableDelayedExpansion' is not good... Is there a way to do it without this option?
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE