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!

Awk help

Status
Not open for further replies.

uguess

Technical User
Nov 5, 2004
40
CA
if i have following path

path1=H:\Smartscan\Canada\35A\Set_DE\

if i want to extract Set_DE thru awk. how can it work.

I tried below command but get errors.


echo $path1 | awk -F:\ "{print $4}
 
As you're in the UNIX Scripting forum, here an unix syntax:
path1='H:\Smartscan\Canada\35A\Set_DE\'
echo "$path1" | awk -F\\ '{print $(NF-1)}'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top