Hello All,
I have a big csv file that containq some infos with a column that has dates
So i need to filter this column of dates with the following conditions
If column date exceeds two months from now i need to add a column to the table with value “type 1”
If column date exceeds 3 months from now i need to add a column with value “type 2”.
I believe that i can do it with for each and if condition but when the file size is big it’ll take a lot of time so i need an optimized solution , any ideas please ??
dt.AsEnumerable.ToList().ForEach(Sub(r)
If (CDate(r("date"))>Today.AddMonths(2)) Then
If (CDate(r("date"))>Today.AddMonths(3)) Then
r("type")="type2"
Else
r("type")="type1"
End If
End If
End Sub
)
Thanks for your prompt reply , here is an exp of input file that need to be filtered and the output must be a data table with all the column of input file plus the column “type”…