batch file to search in txt file for string and get the full line off the string -


i want batch file search in txt file string , full line of it

this txt file input

1:how you

3:im fine

2:yeah

     example      @echo off      set string=3:      echo full line off string %fullline%      pause 

here batch file calls findstr directly, , within loop add text line. if want found text delete line beginning for.

@echo off  set findtext="blah" set findfile="test.txt"  findstr %findtext% %findfile%  /f "delims=" %%a in ('findstr %findtext% %findfile%') echo full line of string %%a 

credits


Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -