Thursday 18 September 2008

recursive for loops

problem: for example, reading a text file input, searching for the entry in a database and outputting specified csv's

what im not doing: hitting this with vbs, because vbs is only for when batch cant do it


try it, recursive for loops arent supported in winxp cmd / batch files, but here is a wee workaround

for /f %%a in (list.csv) do call :list %%a
:list
if not %1'==' for /f "tokens=1-5* delims=," %%a in ('findstr /i %1 db') do echo %%~c,%%~d,%%~e >> summary.csv

save the batch and watch it recurse!

No comments: