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
ignoring a dash in file name LumpSum UNIX for Dummies Questions & Answers 5 08-04-2008 12:47 PM
how to seperate space in a string kittusri9 Shell Programming and Scripting 5 05-08-2008 06:43 AM
dash after ampersant csecnarf UNIX for Dummies Questions & Answers 2 03-12-2008 03:47 PM
double-dash options dhinge Shell Programming and Scripting 1 01-10-2007 10:32 PM
How to remove a file with a leading dash '-' in it's name? GSalisbury UNIX for Advanced & Expert Users 3 05-05-2003 11:28 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 08-21-2008
melanie_pfefer melanie_pfefer is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 234
awk to seperate a string that has a dash

Hello


I have this string

XYZ-ABC
DFT-ERT
QWE-TYU

I want to get the part after the dash. how to do that?

thanks
  #2 (permalink)  
Old 08-21-2008
melanie_pfefer melanie_pfefer is offline
Registered User
  
 

Join Date: Nov 2006
Posts: 234
the correct examples are

XYZ-ABC
XYZ-ERT
XYZ-TYU

meaning the first part XYZ does not change
  #3 (permalink)  
Old 08-21-2008
redoubtable redoubtable is offline
Registered User
  
 

Join Date: Aug 2008
Location: Portugal
Posts: 242
awk -F"-" '{print $2}' filename_where_you_have_the_examples
or
cut -d"-" -f2 filename_where_you_have_the_examples
Closed Thread

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 08:16 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