Hello Hackoo
Checked out the link you provided but haven't messed with trying to tweak that to work for my 74 line replacement need yet. Work has me working a 60+ hour week this week and this project is not work related but my own, so gets set to the side as life gets crazy busy.
Here is a sample of what I have, but it would be 74 lines all consecutive that get changed from one path to another. I just put 8 lines here to test with and show the structure without making this post one that you would have to scroll down the 74 lines for. Also while it says chapters its not chapters that the links point to, but instead of listing the actual names it gives this example a simplistic structure since what is to be replaced is just as simplistic.
The original hyperlinks are like below:
<a target="_top" href="default.htm"> Home[/url]
<a target="_top" href="Chapter1.htm">Chapter 1[/url]
<a target="_top" href="Chapter2.htm">Chapter 2[/url]
<a target="_top" href="Chapter3.htm">Chapter 3[/url]
<a target="_top" href="Chapter4.htm">Chapter 4[/url]
<a target="_top" href="Chapter5.htm">Chapter 5[/url]
<a target="_top" href="Chapter6.htm">Chapter 6[/url]
<a target="_top" href="Chapter7.htm">Chapter 7[/url]
The hyperlink targets are changing to www paths to multiple domains with full URL's. Basically I had a local intranet type of webpage that use to be populated from multiple internet sources by using HTTrack, and instead of using an offline cache of collected information, I am changing to no longer get a copy of sites via HTTRack and instead have it run out to the sources of the URL paths for information that is current vs the last time HTTrack grabbed a copy via scheduled task. I originally had this grabbing offline copies of site information because the internet use to be not everywhere, but these days with hotspots everywhere including xfinity now turns just about every home and business into a hot spot there is no longer a need to have offline data that is gathered through HTTrack and so I am trying to undo the local paths and direct multiple pages to the original sources of the content and because I have built upon this for about 6 years now I have multiple html documents that all were similarly constructed for navigation bar on far left side and so its an easy fix in that the navigation bars are all the same, but tedious to where I have lots of HTML files to edit some of which pivot off of others as it branches out and a line for line replacement I thought their might be a better method vs specifying 74 individual line replacements but say read in a multiple line string and compare and when match found replace that with the correct information.
Just wanted to add that the whitespace doesnt differ between the HTML files either for the navigation html instructions, but maybe whitespace would need to be taken into consideration for multiple line string replacement as a single read-in when comparing.
When messing around with single line replacements in the past I have had to at times read-in the contents to an array and then target the elements in that array to change the characters at the targeted elements locations, but this only seems to work when the depth of the data is always in the same location in the file to be edited. The header information above the navigation hyperlink content is subject to differing among all of the html files and so that makes specifically targeting array elements deeper in a read-in a mess. And I've done this with C++