|more useful options|
Re^2: Batch remove "404 Not Found" URLsby bobafifi (Beadle)
|on Oct 27, 2017 at 06:21 UTC||Need Help??|
Here's what I've been using:
find . -type f -name "*.htm" -print|xargs perl -i -pe 's/http:\/\/example\.com\/[404 Not Found]/g'
I'm afraid I haven't described what I'm trying to accomplish very well, sorry.
1.) I have a list of 300 URLs
2.) I have a folder on my desktop with 100 .htm pages
3.) I want to run that list against those 100 pages and remove URLs
4.) This will leave the <a href tags in place with the text [404 Not Found] (instead of the URL - for example, <a href="[404 Not Found]">[404 Not Found]</a>).
My plan then (since some of her links have descriptive text and others link text), was/is to render those dummy tags in the HTML inactive by doing another find/replace and leaving just <a>[404 Not Found]</a> to display 404 Not Found or the link's descriptive text in the browser.
Thanks again Ken - I'll check out the perlrun link