grep, etc

Bob Stockler bob at trebor.iglou.com
Wed Aug 11 13:26:03 PDT 2004


On Wed, Aug 11, 2004 at 03:18:53PM -0400, Robert Pulliam M.D. wrote:
|     I have created a file using the export commant in filepro.  It is text with a newline record seperator.  the file looks like this:
| 
| ISA*00000089** *
| CLM*inv123456*a*b*c         -213
| SV1*23456*25*A*B            -214
| 
| i WANT TO BE ABLE TO VIEW A RANGE OF LINE USING GREP, MORE OR AWK.   IS THIS POSSIBLE.   IE FROM -213 TO -216

Yes.

  awk '
  {
    if ( $NF = "-213" ) { OK++ ; print ; next }
    if ( $NF = "-216" ) { print ; exit }
    if ( OK ) print
  }' filename

Bob

-- 
Bob Stockler - bob at trebor.iglou.com
Author: MENU EDIT II - The BEST Creator/Editor/Manager for filePro User Menus.
Fully functional (time-limited) demos available by email request (specify OS).


More information about the Filepro-list mailing list