TIP: Click on subject to list as thread! ANSI
echo: 4dos
to: Dale Shipp
from: Gerald Miller
date: 2005-01-11 09:03:48
subject: Search

Hello Dale,

    Responding to a post in the 4DOS area:
    On Monday January 10 2005 at 23:38,
    Dale Shipp [1:261/1466] wrote to All,
    about: Search

 DS>   Is there a command in 4NT that will search a file for a particular
 DS>   string and then allow the string following that to be read?

 DS>   I have seen commands that allow looking for a file that contains a
 DS>   string, but can't see that it does anything other than returning the
 DS>   file name.

 DS>   Explicitly I want to search a file for the string
 DS>   Attachment COnverted:
 DS>   and then take the string following that to use as a file name
 DS>   parameter into another command.

 DS>   I could write a C program to do this, but using 4NT would be easier.

I'm not sure about 4NT, but with 4DOS, I use FFIND.

I don't know if you can apply my example to your requirements but here's
how I use it:

=== Cut Begin: SNIPPET.BTM ===
set xan=%{at}word[2,%{at}execstr[FFIND /k/m/r/t"node 1 (dialup), 1:342/806" %=
C:\Fd\FD.LOG]]

      iff "%xan" NE "Xanadu" then
        goto looper
      else
        call C:\4d\4b\TESTIME.BTM
      endiff
=== Cut End:   SNIPPET.BTM ===

I _WAS_ using the above snippet to synchronize my system clock to that of
my host (1:342/806) by searching my FrontDoor log file for the string
Xanadu.

My Testime.btm would then search the FrontDoor log file for the strings
"RTime" (Remote Time) and "LTime" (Local Time) and
compare the values
following those two strings...

=== Cut Begin: TESTIME.BTM ===
....
  set ret=%{at}time[%{at}word[6,%{at}execstr[FFIND /k/m/r/t"RTime" C:\Fd\FD.LOG]]]
  set lot=%{at}time[%{at}word[6,%{at}execstr[FFIND /k/m/r/t"LTime" C:\Fd\FD.LOG]]]
  set remot=%{at}maketime[%ret]
  set local=%{at}maketime[%lot]
....
=== Cut End:   TESTIME.BTM ===

I hope that is of some help to you.

           Cheers ... Gerald

--- GoldED+/DPMI32 v1.1.5-040330
* Origin: Ant-like, you armor your house in dust. (1:342/512)
SEEN-BY: 633/267 270
@PATH: 342/512 5 140/1 106/2000 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™.