Computing.Net > Forums > Programming > help with awk - sed

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

help with awk - sed

Reply to Message Icon

Name: sunilgeek
Date: October 15, 2008 at 18:34:12 Pacific
OS: Linux
CPU/Ram: 2.5 GHz, 1 GB Ram
Comment:

Hi All,

I have a file with content as given below.

/abc-1/*"/>
/abc-2/*"/>
/abc-3/*"/>
/abc-4/*"/>

I want output as :
abc-1
abc-2
abc-3
abc-4

I tried many awk and sed combination, "/" is road blocker for me.
Please help me.



Sponsored Link
Ads by Google

Response Number 1
Name: klint
Date: October 16, 2008 at 01:32:36 Pacific
Reply:

It doesn't have to be a /. Try sed with another character, like #, instead of /.


0

Response Number 2
Name: ghostdog
Date: October 16, 2008 at 02:43:40 Pacific
Reply:


# awk -F"/" '{print $2}' file
abc-1
abc-2
abc-3
abc-4



0

Response Number 3
Name: sunilgeek
Date: October 16, 2008 at 21:48:43 Pacific
Reply:

thanks so much ghostdog ! .. that worked !


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: help with awk - sed

awk/sed > env.variable from file www.computing.net/answers/programming/awksed-envvariable-from-file/13821.html

Split one column into three with awk www.computing.net/answers/programming/split-one-column-into-three-with-awk/20006.html

Compare files with AWK www.computing.net/answers/programming/compare-files-with-awk/15182.html