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

Truncate line with Sed option

Status
Not open for further replies.

ranjank

IS-IT--Management
May 9, 2003
176
0
0
IN
Hi,

I want to truncate the line with sed option.

-r--r--r-- ppp/user 1072 2005-05-30 22:08:40 ./var/nn/CCCC/resource/default/Setup.html

This is in single line.There are around 150 such lines in a file.I want to extract only /var/nn/CCCC/resource/default/Setup.html and put it in double quotes. "/var/nn/CCCC/resource/default/Setup.html"

Any help on this will be appreciated.

Regards,
Ranjan.
 
I don't know about sed but
Code:
awk '{print "\"" $NF "\""}' input_file
ought to do the job.

Ceci n'est pas une signature
Columb Healy
 
Hi

That would be impossible to do with [tt]sed[/tt] options. But with [tt]sed[/tt] commands is much simple :
Code:
sed 's/.*:[^ ]\+ //;s/.*/"&"/' /input/file

Feherke.
 
Thanks coloumb and feherke.Its working.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top