The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 05-22-2008
selamba_warrior selamba_warrior is offline
Registered User
  
 

Join Date: May 2008
Posts: 12
How to extract first column with a specific character

Hi All,

Below is the sample data of my files:

O|A|571000689|D|S|PNH|S|SI
sadm|ibscml1x|
I|A|571000689|P|S|PNH|S|SI
sadm|ibscml1x|
O|A|571000689|V|S|PNH|S|SI
sadm|ibscml1x|
S|C|CAM|D|S|PNH|R|ZOA|2004
bscml1x|
I|C|CAM|P|S|PNH|R|ZOA|2004
bscml1x|
O|C|CAM|V|S|PNH|R|ZOA|2004
bscml1x|

I need to extract the first column that only contain "I" only?

Please assists


Thanks