Subj : Search To : Dale Shipp From : mark lewis Date : Tue Jan 11 2005 09:11 am i'm responding based on 4DOS and 4OS2 knowledge with the assumtion that 4NT is the same as they are... DS> Is there a command in 4NT that will search a DS> file for a particular string and then allow the DS> string following that to be read? no, not one command... you'd have to work something together... DS> I have seen commands that allow looking for DS> a file that contains a string, right... DS> but can't see that it does anything other than DS> returning the file name. right... 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 DS> a file name parameter into another command. DS> I could write a C program to do this, but using DS> 4NT would be easier. in either one, you'll have to develop the loop to read the file looking for your line and the logic to figure out whether to continue looking or drop out of the loop once you've located your target... unless those two lines are in the same place each time which would make things a lot easier... anyway, something like this might help... set srchfile = blah.txt set srchstr = Attachment Converted: set nextcmd = dir set curlinenum = 0 set curline = set success = no :loop set curline = %@line[%srchfile,%curlinenum] iff %@index[%@upper[%curline],%@upper[%srchstr]] GE 0 then set success=yes endiff set curlinenum = %@inc[%curlinenum] iff %success EQ no then goto loop else set curline = %@line[%srchfile,%curlinenum] endiff %nextcmd %curline written on the fly and not tested... )\/(ark * Origin: (1:3634/12) .