using System.Collections.Generic;
public static void Main()
var data = new List<List<string>>()
new List<string>() { "1", "4", "6", "8" },
new List<string>() { "1", "2", "6", "8" },
new List<string>() { "2", "4", "6", "8" },
new List<string>() { "3", "4", "5", "7" },
foreach(var column in row)
var result = FilterData(data);
Console.WriteLine("----------------");
foreach(var row in result)
foreach(var column in row)
private static List<List<string>> FilterData(List<List<string>> datatable)
var result = new List<List<string>>();
for(var rowindex = 0; rowindex < datatable.Count; rowindex++)
var refrow = datatable[rowindex].Select(item => (string)item.Clone()).ToList();
if (rowindex == 0) continue;
var row = result[rowindex];
var prevrow = datatable[rowindex - 1];
for(var columnindex = 0; columnindex < row.Count; columnindex++)
if (row[columnindex] == prevrow[columnindex])