Vicky_K
(Vicky K)
November 22, 2023, 8:02am
1
Hi All,
Data 1 we received as CSV file format it is like data table and having 1L rows data.
like database
And we receive one input file we have coulmn ID,
from that input file we need to compare CSV file coulmn “ID” if it maches the id means we need to get Name column and save into excel
Note : CSV file contain lakh datas so should we go with LINQ
else vb.net code also please suggest.
I attached the screen shot for better understanding. (I created sample one)
Thanks,
Vicky
@Vicky_K
outputdt=dt1.AsEnumerable.Where(function(a) dt2.AsEnumerable.Any(Function(b) b(0).ToString.trim.Equals(a(0).ToString.trim))).CopyToDataTable
here dt1 is the CSV file and dt2 is Input File
Vicky_K
(Vicky K)
November 22, 2023, 8:17am
3
Thanks.
Suppose i need to extract one more column in input means when id is matched what we need to add?
I need location and Priority from input sheet. (if ID match in Data 1 datatable)
@Vicky_K
use this expression in another assign activity below the above expression
finaldt=dt1.DefaultView.ToTable(False,"ColumnName","ColumnName2")
you can add columnNames which ever columns you want
1 Like
Vicky_K
(Vicky K)
November 22, 2023, 10:59am
6
LINQ is fast right comparing other?
system
(system)
Closed
November 25, 2023, 11:01am
8
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.