home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PROGRAMS / UTILS / COMPRESS / LOOKFR.ZIP / LOOKFOR.DOC < prev    next >
Encoding:
Text File  |  1990-10-15  |  6.4 KB  |  147 lines

  1.                       LOOKFOR .ZIP ASCII SEARCH UTILITY
  2.  
  3. Syntax:  LOOKFOR {ZipFile} {Search criteria}
  4.  
  5. To print the results of your search: LOOKFORP {ZipFile} {Search criteria}
  6.  
  7. This very simple batch file allows you to search inside ASCII .ZIPs for
  8. text WITHOUT UNZIPPING THE FILE.  It shows the line or lines that match
  9. your search criteria, or can print them.  LOOKFOR.BAT is very useful for 
  10. searching BBS file lists.  You can download these file lists ZIPPED, then 
  11. use LOOKFOR to find file descriptions with your search criteria without
  12. unzipping them.  This saves a lot of online time spent searching for files.
  13.  
  14. LOOKFOR.BAT uses the amazing FGREP ASCII search program by Chris Dunford,
  15. PKware's fine PKUNZIP program, and the good ol' DOS program MORE.COM.  You
  16. must have these programs available in the same directory as the LOOKFOR 
  17. batch file in order for this program to work.  The LOOKFOR batch file
  18. functions by using PKUNZIP's -c option, which lists the contents of a zip
  19. to the screen. We then send or "pipe" this output to FGREP, which searches
  20. for a word or words you specify as the {search criteria} from the .ZIP
  21. file's output.  MORE.COM is used in case the listing is too big for the
  22. screen.  PKUNZIP and FGREP are available through many BBS systems;
  23. MORE.COM is a DOS utility program.
  24.  
  25. Follow these instructions: 
  26.  
  27. 1. Copy PKUNZIP.EXE, FGREP.COM, MORE.COM, LOOKFOR.BAT and LOOKFORP.BAT
  28. to the same directory.  If you don't do this LOOKFOR will display an error
  29. message and will not function.
  30.  
  31. 2. To run LOOKFOR, type LOOKFOR, the zipfile name and the search criteria (in
  32. quotes if it's more than one word) at the DOS prompt. Make sure you're in
  33. the directory where you copied these files.
  34.  
  35. Example:  If you want to look in the file PRETTY.ZIP for the word THINGS:
  36.  
  37.           at the prompt type  LOOKFOR PRETTY.ZIP THINGS
  38.  
  39. If you're looking in the file NATURE.ZIP for the words OAK TREES:
  40.  
  41.           at the prompt type LOOKFOR NATURE.ZIP "OAK TREES"
  42.  
  43. NOTE THAT YOU MUST USE QUOTATION MARKS IF THE TERM YOU'RE LOOKING FOR
  44. IS MORE THAN ONE WORD, or LOOKFOR will not function properly.  If you'd like,
  45. you can use quotes all the time so you don't forget.  One word criteria in
  46. quotes work fine.  YOU CAN USE UP TO EIGHT WORDS in your search criteria.
  47.  
  48. If the file you wish to search is not in the same directory as LOOKFOR,
  49. simply specify the directory:
  50.  
  51. To search in the file NICE.ZIP in directory C:\OVERALL for the word THINGS:
  52.  
  53.           at the prompt type LOOKFOR C:\OVERALL\NICE.ZIP THINGS
  54.  
  55. You'll see SEARCHING...PLEASE WAIT on the screen.  You will then see all
  56. lines that contain the word THINGS on the screen.  If the file you're
  57. searching is long this can take a few minutes.
  58.  
  59. 3. To print the results of your search instead of their appearing on the
  60. screen, use LOOKFORP.BAT.  Follow the same instructions using LOOKFORP
  61. instead of LOOKFOR.  This option will print to LPT1:; if your printer is
  62. hooked up to a different port, see instructions below.
  63.  
  64.  
  65.  
  66. To print text with the word THINGS in the file NICE.ZIP in directory
  67. C:\OVERALL:
  68.  
  69.           at the prompt type LOOKFORP C:\OVERALL\NICE.ZIP THINGS
  70.  
  71. POSSIBLE PROBLEM:  For reasons that I don't completely understand, one of
  72. the programs used by LOOKFOR will sometimes write temporary files onto your
  73. hard drive under certain circumstances:
  74.  
  75.        1.  If you specify more than one word in your search
  76.            criteria and forget to enclose the words in
  77.            quotation marks
  78.  
  79.        2.  If the search criteria is not found
  80.  
  81. Note that the temporary files are only written under these circumstances,
  82. and NOT CONSISTENTLY.  The temporary files in my tests were always
  83. written to the root directory, and they always started with numbers.  Check
  84. for these files if either one of the above situations occurs and delete them.
  85. You'll know that the files were generated by LOOKFOR because the date and
  86. time will match the date and time you ran LOOKFOR.
  87.  
  88. Options for advanced users:
  89.  
  90. - SEARCH A SPECIFIED FILE ONLY - use an ASCII word processor to substitute
  91. a file name for the %1 in LOOKFOR.BAT or LOOKFORP.BAT.  I use this myself to
  92. search the BBS EXECPC's file list.  I ZIPped all of the BBS's directory of
  93. files in one ZIP called EXECPC.ZIP.  I then substituted EXECPC.ZIP for the %1
  94. expression in LOOKFOR.BAT, and changed the numbering of the % expressions
  95. after FGREP so they start with %1:
  96.  
  97. PKUNZIP -C EXECPC.ZIP | FGREP %1 %2... etc.  
  98.  
  99. I changed the name of LOOKFOR.BAT to EXECLOOK.BAT.  Now I just type:
  100.  
  101. EXECLOOK "THINGS"
  102.  
  103. to search for the word "THINGS" in this file.  I have modified LOOKFOR for
  104. several text files of BBS file lists, so I have a batch file for each one.
  105.  
  106. - SEND THE RESULTS OF YOUR SEARCH TO A PRINTER CONNECTED TO A
  107. DIFFERENT PORT THAN LPT1- Just use an ASCII text editor to modify the line
  108. beginning with PKUNZIP in LOOKFORP.BAT to change the port:
  109.  
  110. PKUNZIP -C %1 | FGREP %2 %3 %4 %5 %6 %7 %8 %9 > LPT2:
  111.  
  112. for port LPT2:
  113.  
  114. - USE LOOKFOR WITH OTHER FILE COMPRESSION PROGRAMS- You can modify
  115. LOOKFOR to work with file compression programs other than PKUNZIP, as long as
  116. the program has an "extract to screen" option.  For example, LHarc has an option
  117. "e" that extracts to the screen.  To use LOOKFOR with LHarc, you would modify
  118. the LOOKFOR.BAT line that starts with PKUNZIP to:
  119.  
  120. LHarc e %1 | FGREP %2 %3 %4 %5 %6 %7 %8 %9 | MORE
  121.  
  122. Also change all references to PKUNZIP in LOOKFOR.BAT to LHarc references so
  123. LOOKFOR's error checking and messages are correct.  The line of LOOKFOR.BAT
  124. that says "if exist PKUNZIP.EXE" would be changed to "if exist LHarc.exe", etc. 
  125. You get the idea.
  126.  
  127.  
  128.  
  129. ---------------------------------------------------------------------------- 
  130.  
  131. I hereby release LOOKFOR into the public domain for the public's unlimited
  132. use.  That's just the kind of guy I am.  HOWEVER, please make ABSOLUTELY
  133. sure that if you like this program and use it that you register your
  134. copies of PKUNZIP and FGREP.  Registration information is contained in
  135. those .ZIPs.  
  136.  
  137. A final note: this batch file has only been tested with DOS 3.3.  I cannot
  138. assume any responsibility or liability for this program not working
  139. correctly on other versions of DOS.  Nor am I responsible or liable for
  140. any damages, consequential or inconsequential, arising from the use of
  141. LOOKFOR.BAT or LOOKFORP.BAT.  Hey, it's free, what do you want for nothing?
  142.  
  143. NEIL ZIMMERMAN
  144. Englewood, CO USA
  145. Contact me on EXECPC or CompuServe 72417,723.
  146.  
  147.