![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to sort alphabetically after finding values | doubleminus | UNIX for Dummies Questions & Answers | 4 | 04-28-2008 03:45 AM |
| Converting Binary decimal coded values to Ascii Values | gaur.deepti | UNIX for Advanced & Expert Users | 3 | 04-02-2008 09:33 AM |
| Finding a specific UID on a site with hundreads of users. | maxalarie | AIX | 1 | 03-03-2008 10:17 AM |
| Finding a specific pattern from thousands of files ???? | aarora_98 | Shell Programming and Scripting | 6 | 02-17-2006 05:28 AM |
| How to read specific lines in a bulk file using C file Programming | rajan_ka1 | High Level Programming | 10 | 11-10-2005 12:29 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
finding specific values in a within a file
Hi everyone,
Can anyone guide me on how to search through a huge file and look on specific column and if it finds a discrepancy on that column that does not conform to the specified criteria, ie (1) Numeric and (3) alpha chars F123 or G333..etc, etc! then idientify it and redirect that whole row to a some newfile.txt ie input file ..... john watson F300 2005 234567 mary millington g306 2002 343567 tony hancock hi45 2004 999999 Frederick Smith T302 888883 John Semple VIiv 223441 Tony Mallony F333 867492 outputfile...... tony hancock hi45 2004 999999 John Semple VIiv 223441 |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
awk '$3 !~ /[A-Za-z][0-9][0-9][0-9]/' < inputfile > outputfile
Should that not work, try nawk rather than awk. |
|
#3
|
||||
|
||||
|
Might have to match beginning/end of string, like....
Code:
awk '$3 !~ /^[A-Za-z][0-9][0-9][0-9]$/' < inputfile > outputfile |
|
#4
|
|||
|
|||
|
matching strings
Thanks for that, it works a treat!
|
|||
| Google The UNIX and Linux Forums |