using wildcard with Replace command
Posted: Wed May 21, 2003 5:23 pm
I searched through the forums but haven't really found an answer to this. I would have thought this was a question often asked.
Is there any way to use wildcards when using the replace command?
For example, I have a list of 2000 items as shown below. I want to remove the [filename].html from each line in the list. using * as a wildcard doesn't work. Is there a way to do this?
/entertain/books/feature/aakd118books/aakd118books.html
/travel/places/feature/aakd199703_terrific/aakd199703_terrific.html
/travel/places/feature/aakd29getaway/aakd29getaway.html
should end up like this:
/entertain/books/feature/aakd118books/
/travel/places/feature/aakd199703_terrific/
/travel/places/feature/aakd29getaway/
also would there be a way to remove duplicate lines such as:
/entertain/books/feature/aakd118books/
/travel/places/feature/aakd199703_terrific/
/travel/places/feature/aakd29getaway/
/travel/places/feature/aakd29getaway/
/travel/places/feature/aakd29getaway/
I know nothing about PERL (the only close answer I found searching the forums)
Thank you!
Is there any way to use wildcards when using the replace command?
For example, I have a list of 2000 items as shown below. I want to remove the [filename].html from each line in the list. using * as a wildcard doesn't work. Is there a way to do this?
/entertain/books/feature/aakd118books/aakd118books.html
/travel/places/feature/aakd199703_terrific/aakd199703_terrific.html
/travel/places/feature/aakd29getaway/aakd29getaway.html
should end up like this:
/entertain/books/feature/aakd118books/
/travel/places/feature/aakd199703_terrific/
/travel/places/feature/aakd29getaway/
also would there be a way to remove duplicate lines such as:
/entertain/books/feature/aakd118books/
/travel/places/feature/aakd199703_terrific/
/travel/places/feature/aakd29getaway/
/travel/places/feature/aakd29getaway/
/travel/places/feature/aakd29getaway/
I know nothing about PERL (the only close answer I found searching the forums)
Thank you!