grep, etc

Jean-Pierre A. Radley appl at jpr.com
Wed Aug 11 13:55:13 PDT 2004


Bob Stockler propounded (on Wed, Aug 11, 2004 at 04:26:03PM -0400):
| 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

	sed -n '/-213/,/-216/p' filename

-- 
JP


More information about the Filepro-list mailing list