home *** CD-ROM | disk | FTP | other *** search
/ Shareware Supreme Volume 6 #1 / swsii.zip / swsii / 197 / DOS5BAT.ZIP / FINDTEXT.BAT < prev    next >
Encoding:
DOS Batch File  |  1991-11-03  |  1.1 KB  |  33 lines

  1. @ECHO OFF
  2. REM This is FINDTEXT.BAT
  3. REM
  4. REM FINDTEXT.BAT will search through all files in the current directory
  5. REM for single text words you specify and show you the names of all the
  6. REM files you searched preceded by a set of dashes. For those files
  7. REM containing the search text, it will also display each line (and the
  8. REM line number) that contains this text.
  9. REM It will also let you narrow the search by entering a custom filespec
  10. REM at the end of the line. FINDTEXT Birthday *.TXT would limit the search
  11. REM for "Birthbay" to files with .TXT extensions. If you entered just
  12. REM FINDTEXT Birthday, FINDTEXT would look inside every file in the directory.
  13. REM
  14. SET FLS=*.*
  15. IF %1!==! GOTO OOPS
  16. IF %2!==! GOTO START
  17. SET FLS=%2
  18. :START
  19. ECHO Searching for text %1 . . .
  20. FOR %%A IN (%FLS%) DO FIND /N "%1" %%A
  21. GOTO END
  22. :OOPS
  23. ECHO Enter the text you want to
  24. ECHO search for in the current
  25. ECHO directory after the %0
  26. ECHO.
  27. ECHO If you want, follow %0 and the
  28. ECHO text you want to search with a
  29. ECHO filespec such as *.BAT or *.TXT
  30. ECHO.
  31. ECHO Otherwise this will search *.*
  32. :END
  33. SET FLS=