The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Multiple input field Separators in awk. kinksville Shell Programming and Scripting 4 04-25-2008 06:12 PM
I need help counting the fields and field separators using Nawk scrappycc Shell Programming and Scripting 3 02-06-2008 11:47 PM
Awk Multiple Field Separators Tonka52 Shell Programming and Scripting 7 04-07-2004 10:37 PM
field delimiter with a space or more uphamtn UNIX for Dummies Questions & Answers 3 05-15-2003 05:22 PM
How do you represent a field delimeter that is a space??? TRUEST UNIX for Dummies Questions & Answers 1 05-04-2003 10:01 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 04-25-2008
doubleminus doubleminus is offline
Registered User
  
 

Join Date: Apr 2008
Posts: 27
Multiple field separators in awk? (First a space, then a colon)

How do I deal with extracting a portion of a record when multiple field separators are involved.

Let's say I have:
Mike Harrington;(555) 555-5555:250:100:175
Christian Dobbins;(555) 555-2358:155:90:201
Susan Dalsass;(555) 555-6279:250:60:50
Archie McNichol;(555) 555-1348:250:100:175
Jody Savage;(555) 555-1278:15:188:150

How can I print only last names beginning with a D? I just want the Dalsass and Dobbins to print.

This... awk -F: '$1 ~ / D/ {print $1}' donors.txt

just gives me both names. How can I eliminate the first names from printing?

Thanks!

Last edited by doubleminus; 04-25-2008 at 03:27 AM..
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:40 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0