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!

Reconstructing URL....

Status
Not open for further replies.

stu78

Programmer
May 29, 2002
121
GB
hi,

I am trying to get a url entry from a log file, problem is that it appears on two seperate lines, in this format.

<date data <date data /resource.http>

I need to reconstruct this.

Any Ideas?
 
Hi -

Here's one of a million ways to do this.

sed '
/http/{
s/.*\(http\)/\1/
s/>;//
N
s/\n.*\//\//
s/>//
}' input.log

Cheers,
ND [smile]

bigoldbulldog@hotmail.com
 
here's an awk method which may do something close to what you want.

/http:/ {
a = substr($0,1,length-2)
getline
print a $3
}
CaKiwi
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top