The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


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 !!

Closed Thread
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 12-12-2001
Registered User
 

Join Date: Jul 2001
Posts: 62
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  
Old 12-13-2001
Registered User
 

Join Date: Dec 2001
Location: kuala lumpur
Posts: 21
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
Closed Thread

Thread Tools
Display Modes




All times are GMT -7. The time now is 02:10 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0