0

I have this menu in almost 2.000 html files. Every link have a number between brackets in the final (that number represents the numbers of the articles I have in that section).

<li><a href="link_one.html" title="Link One">Love and Letters (25)</a></li>
<li><a href="link_two.html" title="Link Two">Books and Readers (23)</a></li>
<li><a href="link_3.html" title="Link 3">Windows and Doors (24)</a></li>
<li><a href="link_4.html" title="Link 4">Names and Addresses (5)</a></li>
<li><a href="link_5.html" title="Link 5">Other Stuff (14)</a></li>
<li><a href="link_6.html" title="Link 6">Cars and Roses (14)</a></li>
<li><a href="link_7.html" title="Link 7">Mobile and Laptop (36)</a></li>

Now, I have to check if there are any other different numbers than these ones in all 2.000 menu html files. For example, I want to find those .html pages that have a different numbers on link one (26) or on the link 5 (13) like in this menu:

<li><a href="link_one.html" title="Link One">Love and Letters (26)</a></li>
<li><a href="link_two.html" title="Link Two">Books and Readers (23)</a></li>
<li><a href="link_3.html" title="Link 3">Windows and Doors (24)</a></li>
<li><a href="link_4.html" title="Link 4">Names and Addresses (5)</a></li>
<li><a href="link_5.html" title="Link 5">Other Stuff (13)</a></li>
<li><a href="link_6.html" title="Link 6">Cars and Roses (14)</a></li>
<li><a href="link_7.html" title="Link 7">Mobile and Laptop (36)</a></li>

Basically, I need to compare and discover numbers that are not the same as in the first menu. Can anyone give me an idea? Remember, I have 2.000 files, so I can compare one by one :(

2
  • Do you really have the same menu hardcoded in 2000 files? Why don't you have an unique include file?
    – Toto
    Feb 9, 2019 at 15:44
  • because I tested a wrong regex formula, and some elements changed :)
    – Just Me
    Feb 9, 2019 at 16:21

2 Answers 2

1

Processing 2000 files manually will be impractical, so I searched for methods to do it automatically and found this site that claims to merge several excel files into one. I tried and could merge 2 files, that I then downloaded to my box. so I think they can do it.

http://www.docsoso.com/excel/combine-excel.aspx

No guarantee from my side. I googled to reach that and tried.

upload your 2000 excel files (you can upload many files in one go) to the site and get a single excel file. If the site doesn't allow so many files in one go, at least merge as many files as the site allows, so that you are left with 5 or 10 files that are still manageable manually.

once, a single file has been created, the links as you give above should be in A column.

Open the file and select all data in A column and sort

Select all data in A column, go to Menu - Data - click on Remove Duplicates.

It will remove all duplicate entries, meaning the entries from different files that had same article number.

You have only those lines left that have different number of articles.

0

I find the answer with regex. To verify the formula below, please compare those 2 menu on my basic post. This regex will select all lines from the second menu which does not have the same numbers as in the first menu.

SEARCH:

\s+<li><a href=".*\.html" title=".*">.* (?:(?!\b(25|23|24|5|14|14|36)\b).)*<\/a><\/li>$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .