Hello. Sed is a tough learn.
I need to take several files each with a bunch of urls in them and get rid of parts of the url.
In the code of the files, it reads something to the effect of:
Code:
<a href='http://www.yahoo.com/here-is-testpage-this-is-the-page.aspx'>
<a href='http://www.yahoo.com/here-is-goodpage-this-is-the-page.aspx'>
<a href='http://www.yahoo.com/here-is-badpage-this-is-the-page.aspx'>
I need to end up with just
Code:
testpage
goodpage
badpage
So i need to get rid of the
Code:
<a href='http://www.yahoo.com/
and the
and then the
Code:
-this-is-the-page.aspx'>
Currently, i open the files up in gedit and do find and replace, where i find "here-is-" and replace it with nothing, so that deletes it.
There must be a way to use sed. I want to write a few scripts to do this automatically so that i don't have to manually do this. (there are a lot of files to do this on)