TIP: Click on subject to list as thread! ANSI
echo: 4dos
to: Tony Pater
from: Jack Stein
date: 1998-10-31 09:12:00
subject: Testing for String in Fil

Tony Pater wrote in a message to Winston Smith:

 TP>  What I need to do is to create a filter (REXX would be
 TP> nice), where  it would search the folders for a key
 TP> phrase/word then ask if I  wish to 'read' those files found
 TP> with matching word/string, and/or  ask me if I wish to :

 TP>  1. copy to ascii file
 TP>  2. strip out the word/phrase or the whole line
 TP>  3. strip out 'n' lines above and 'n' lines below the found
 TP> word/     phrase.
 TP>  4. Ask if I wish to read 'n' lines above and 'n' lives
 TP> below the     found word/string in the message(s) ?

 TP>  In addition to searching/looking at file/message contents,
 TP> I need  to 'strip out' several lines of advertising that are
 TP> appended to  each/every email coming via a forum. (They
 TP> place adverts at the  bottom of every email that comes
 TP> through within the forum).  So far I've had a look at *nix
 TP> tools 'head' and 'tail' in conjuntion  with 'grep'  ......
 TP> but REXX or 4os2 'btm' would be a better  solution as it
 TP> requires only one call, whereas tail/grep etc would  involve
 TP> 3 calls ....

 TP>  I suppose it comes down to a REXX search and filter routine
 TP> ? 

Yes, all this is rather simple with REXX. A good bit of work, but simple as
far as REXX is concerened.

 TP>  And yes, you're dead right ... I should learn REXX

Yes, post this in the OS2REXX echo for help there.  It is really simple to
look for the files and search for the text string, delete text and massage
the file anyway you want with rexx.  You would not believe what I do with
*.msg files in the cooking echo to search for valid recipes and convert
them to the correct import format for QBOOK.  REXX is perfect for this type
of thing, and of course, a REXX script runs 4OS2 batch commands just fine
if you want, but seldom (never?) is necessary.  This would be a nice
project to learn REXX.

                                              Jack 
--- timEd/2-B11
* Origin: Jack's Free Lunch 4OS2 USR 56k Pgh Pa (412)492-0822 (1:129/171)
SEEN-BY: 396/1 632/0 371 633/260 267 270 371 635/506 728 639/252
@PATH: 129/171 3 11 270/101 396/1 633/260 635/506 728 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.