multithreading - Batch search multiple strings simultaneously -
i have large database of equipment:
equipment500 equipment501 .......... equipment998 equipment999
as larger database details equipment:
equipment1:details.... equipment2:details.... .................. equipment9998:details.... equipment9999:details....
what need, select details equipment need:
for /f "tokens=* delims= " %%a in (%cd%\equipment.db) ( findstr /i /c:"%%a" details.db > output\%%a )
the output be, of course, folder files:
in equipment500 equipment500:details.... in equipment501 equipment501:details.... .................. in equipment998 equipment998:details.... in equipment999 equipment999:details....
the problem takes lot of time.
i need multithreaded runs more instances of findstr (preferably 500) @ sametime processing instantly.
idea appreciated. thank you!
@echo off echo building input files (this needs time): del *.db /l %%i in (500,1,999) @echo equipment%%i>>equipment.db /l %%i in (1,1,9999) @echo equipment%%i:detailswhatever>>details.db echo %time% start adapting rem adapt equipment.db: (for /f "delims=" %%i in (equipment.db) echo %%i:)>equip.db rem find strings: echo %time% start searching findstr /g:equip.db details.db >output.txt echo %time% done
note: "equipment.db" has adapted, because searching "equipment2" find "equipment20", equipment21"... "equipment200" ...
Comments
Post a Comment