Where clause and Select clause can be dynamic.
I have the below code, which is working well for static columns
var q = (from a in Parse_CSV(@"fileName1").AsEnumerable()
join b in Parse_CSV(@"fileName2").AsEnumerable()
on a.Field<string>(0) equals b.Field<string>(0)
where a.Field<string>(1) != b.Field<string>(1) ||
a.Field<string>(2) != b.Field<string>(2)
select new
{
col1 = a.Field<string>(0),
col2 = a.Field<string>(1) == b.Field<string>(1) ?
"0" : a.Field<string>(1),
col3 = a.Field<string>(2) == b.Field<string>(2) ?
"0" : a.Field<string>(2)
}).ToList();
how can I change,
In where column, a.Field(x) -> x from 1 to length. In
select column, col1 = a.Field(0) -> col1 till... length
Where length is known number at run time