So I'm trying to make a script that find matches in the column based on its header. So that I can easily have an overview of all duplicates in the table. The original table is gigantic and counting by hand has not been very successful. Below is an example
Lets say that the table looks like this: (the same, except for the amount of rows and columns)
+---+---+---+---+---+---+
| w | o | p | w | g | h |
+---+---+---+---+---+---+
| p | k | m | n | r | b |
| h | p | x | v | b | e |
| w | r | q | b | h | h |
| u | o | t | w | h | s |
| a | o | p | w | g | h |
+---+---+---+---+---+---+
So in the first column, we would have two (2) matches of w
, and in the second three (3) matches of o
, the third two (2) of p
, fourth three (3) matches of w
, fifth two (2) of g
and in the last three (3) matches of h
.
So I'm also counting the header as a duplicate.
I have found this snippet, but it finds duplicates in the whole table, I just want to find duplicates in the same column.
The table is currently being display as
<table border="1" style="width:100%; border: 1;">
<tr>
<th>w</th>
<th>o</th>
<th>p</th>
<th>w</th>
<th>g</th>
<th>h</th>
</tr>
<tr>
<td>p</td>
<td>k</td>
<td>m</td>
<td>n</td>
<td>r</td>
<td>b</td>
</tr>
<tr>
<td>h</td>
<td>p</td>
<td>x</td>
<td>v</td>
<td>b</td>
<td>e</td>
</tr>
<tr>
<td>w</td>
<td>r</td>
<td>q</td>
<td>b</td>
<td>h</td>
<td>h</td>
</tr>
<tr>
<td>u</td>
<td>o</td>
<td>t</td>
<td>w</td>
<td>h</td>
<td>s</td>
</tr>
<tr>
<td>a</td>
<td>o</td>
<td>p</td>
<td>w</td>
<td>g</td>
<td>h</td>
</tr>
</table>
Is this doable?