The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Need Help Urgent SanjayLinux Shell Programming and Scripting 4 10-28-2007 10:41 PM
URGENT,URGENT- Need help tape drive installation sriny UNIX for Advanced & Expert Users 3 11-16-2006 11:43 AM
URGENT---URGENT--No OK PROMPt after RSC CONFIG sriny SUN Solaris 7 10-29-2006 07:06 AM
Urgent !! desiondarun UNIX for Dummies Questions & Answers 1 08-08-2006 05:49 AM
urgent 2 hamoudzz UNIX for Dummies Questions & Answers 1 03-03-2004 05:09 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-22-2007
Registered User
 

Join Date: Feb 2007
Posts: 7
Help me for AWK URGENT

i have a record like

1,23423,4545,6767,89898,3434,121212,123123,322
2,23233,3434,4545,56566,rxrx,e344343,343434,3434
1,23223,336,78787,78787,654,6767677,6877989,7878

i want to check the $6 field if its start with any letters, i want to move this record to some other file and keep rest of the records in the same files

Please help me
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 02-22-2007
Registered User
 

Join Date: Mar 2006
Location: Bangalore,India
Posts: 1,397
Code:
awk -F"," ' { if($6 ~ /^[a-zA-Z]/) print > "newfile"; else print > "file" } ' < file
Reply With Quote
  #3 (permalink)  
Old 02-22-2007
Registered User
 

Join Date: Feb 2007
Posts: 7
Thanks Anbu
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:21 PM.


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 Global Fact Book

Content Relevant URLs by vBSEO 3.2.0