How do I pull this information out of this file? sed? grep?

F

Fleximous

Guest
Hello,

I hope someone can help..

If I have a file with say the following content:

cat test
fjnjsdnfjnsdjfURLHERE
lmdslfmdsfURLHERE
kmkmkdmfkkmk4m5k456mk45URLHERE
wewew

What would I need to do to just search throught this file and pull out all the URLs?

So the end result I would just want to output

URLHERE
URLHERE
URLHERE

I couldnt post actual URLs as I'm too new to the site. But imagine the URL stars with the usual h t t p : / /

Many thanks,
 


Try this:

Code:
sed 's/http/\^http/g' [B]YOURFILENAME[/B] | tr -s "^" "\n" | grep http| sed 's/\ .*//g'
 

Members online


Top