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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

my sed is aweful

Status
Not open for further replies.

butterfm

Programmer
Feb 15, 2002
132
GB
Sorry guys - need help with a truly simple sed question.

I have a file with the following

\dir1\dir2\file.exe '\path1\path2\blah' '\path3\path4\blah'

how in sed do I change it so that the "\" in only the first path are changed to "/"

e.g.

/dir1/dir2/file.exe '\path1\path2\blah' '\path3\path4\blah'

Ta,
Matt
 
A starting point (without sed):
nawk '{gsub(/\\/,"/",$1);print}' /path/to/input > output

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks for the quick answers guys. I went for PHV's awk solution - it makes more sense to me than the sed method.

Thanks,
Matt.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top