I know this could be done manually with some hardcoded Linq Joins. However, I would like to come up with an elegant way to do this in bulk due to the high number of .csv files I have.
Code:
var dir = Directory.EnumerateFiles(@"C:\IIP_2\", "*.csv", SearchOption.AllDirectories);
var dtCombined = new DataTable();
var lst = new List<DataTable>();
foreach (var v in dir) { lst.Add(GetCSVRows(v, true)); }
//Take List<DataTable> and combine into dtCombined ????
How can I combine this List into one, possibly with a Lambda statement ?
Thanks in Advance !
Would this work for you? You should be able to avoid use the list of DataTables altogether.
If you change GetCSVRows to return an
IDataReader, you can use Load, which may be faster.