Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

extracting a word

Status
Not open for further replies.

HIB049

Technical User
Jan 31, 2003
19
GB
Hi Guys,

Need you quick assistance on the below, trying to extract a word from a variable

i.e. acmi101[space]acmi102[space]acmi103[space]acmi104

When i use the following code awk '{$2=""}1' it leaves a space in the variable, need to get rid of the space that it leaves. Any ideas.

result, would be

acmi101[space][space]acmi103[space]acmi104

need to get rid of the extra space.
 
What about this ?
awk '{sub(" "$2" "," ")}1'

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top