![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to extract only first column from the file | selamba_warrior | Shell Programming and Scripting | 11 | 05-21-2008 02:52 AM |
| How to extract a column from two different files in AWK? | solracq | Shell Programming and Scripting | 7 | 04-29-2008 06:21 AM |
| column extract help | cvm | Shell Programming and Scripting | 1 | 04-24-2008 04:19 PM |
| Extract column data from File | sudheshnaiyer | UNIX for Dummies Questions & Answers | 3 | 10-11-2007 09:52 PM |
| extract column based on name | t27 | UNIX for Dummies Questions & Answers | 3 | 08-29-2007 01:04 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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 |
|
||||
|
If the current line matches I at start of line (that's the caret ^), replace the whole line with just the part which matched (that's what the parentheses are for; they capture the match into \1) and print it.
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|