The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Special Forums > UNIX Desktop for Dummies Questions & Answers
.
google unix.com




Thread: Grep
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 05-25-2009
donisback donisback is offline
Registered User
  
 

Join Date: May 2009
Posts: 9
Grep

Hi,
I have a file as:

Code:
IIN*00*00*ZZ*NDC *ZZ*11847*090520*0200*U*00401*000000001*0*P*>~GS*HP*NDC STD REMIT*1184722779*20090520*0200*63*X*004010X091A1~ST*835*10001~BPR*I*252480.19*C*CHK************20090515~TRN*1*0010855862*1952931460*12427008150981~DTM*405*20090514~N1*PR*CALIFORNIA*XV*H00~N3*ireland~

I want to extract 'CALIFORNIA' from the above one line file. The file will contain 'N1*PR*------' . I want to extract the string after N1*PR*.

Appreciate your help.

Regards,
Anil