I need to make statistics of data which is fetched from an HTML table. The first column is gatewayId, the second one is statusId and the third one gsmError. I successfully filtered that table and pushed those values into an array.
Now I need to make a list of unique gateways from that array. I do not know which values are gonna be in that array, I just know that they are contained in column "10".
The array looks like this: [ "2951", "3", "511", "2737", "3", "502", "2737", "3", "502", "2732"...]
let messageLogTable = $("#tableId");
var filteredColData = [];
messageLogTable.find('tr').each(function(rowIndex, rowData) {
if(rowIndex > 0){
$(this).find('td').each(function(colIndex, colData) {
if(colIndex === 10 || colIndex === 11 || colIndex === 17) {
filteredColData.push($.trim(colData.textContent));
}
});
}
});
console.log(filteredColData);
The result should be like this: 2951, 2737, 2732
I would like that this is done using jQuery, if possible.
Thanks!