![]() |
|
|
|
|
|||||||
| 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 !! |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#1
|
|||
|
|||
|
Help with awk
Hi all,
Suppose I have a file called details: The data in the file is like : RIM 10 ACCT USA SAM 15 MATH USSR TIM 20 COMP AUST NIN 25 COMP JAPN now i want to pull out all the details of the users in USA & USSR and direct them to a file. awk `$4="USA" || $4="USSR" {print} ` details>new_details can somebody kindly tell me where I am going wrong . Thanks. Rooh |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
use == operator instead of =
use single qoute (') instead of reverse qoute (`) awk '{$4=="USA"||$4=="USSR" {print $0} details > newdetails |
|||
| Google The UNIX and Linux Forums |