If you know that there will be something like

7 rows returned. 
srvrmgr:s1_nxlkdev5>  
        Then you could do something like:

      while (<FILEIN>) {
           chomp;
         last if ( /^\d+\s+rows\s+returned\.$/ );  # if this can be an error
or something else
                                                                   # then
you would need other code here.
         #
           # do whatever processing here
         #
       } # while of read loop

Wags ;)

-----Original Message-----
From: Najamuddin, Junaid [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 08, 2001 07:42
To: '[EMAIL PROTECTED]'
Subject: Formatting


Hi, all

I need some help please
I have a code to format some text
The problem is that it is not doing exactly what I want
sample of file is enclosed 
the out.txt is the input file which is being read by the code
The script chops the first 21 lines
after running thru the script it looks like outto.txt
The problem is that it leaves the last two lines which I do not want
Another thing is that the contents of out.txt may vary it may have more or
less lines
But the top portion is constant so that we can take out 21 lines easily 
What to do with the bottom two lines
What I need is to chop off the last two lines.

Please let me know if you have any questions

Thanks
junaid

for /f "skip=21 tokens=*" %%j in (c:\batch\temp\out.txt) do echo %%j >>
c:\batch\temp\outto.txt

 <<out.txt>>  <<outto.txt>> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to