bp777
September 9, 2021, 12:18pm
1
I have two excel files - excel1 and excel2 .
Both excel files contain Serial Number column and they don’t contain same number of rows.(excel1 contains more rows than excel2).
Also, there are more than 15.000 rows in both files.
What I need to do is to compare those two excel files and to get values from Serial Number column that exist in excel1 but don’t exist in excel2.
Thanks in advance.
Srini84
(Srinivas Kadamati)
September 9, 2021, 12:22pm
2
@bp777
Check below for your reference
Hi Team,
I have a sheet1 with below values
[image]
Sheet2
[image]
I need to compare sheet1 and sheet2 and get the matched records and corresponding grade and need to generate sheet3
sheet3
[image]
Could anyone help how to complete this using linq query?
Thanks,
Ula
Hope this may help you
Thanks
1 Like
prasath_S
(prasath S)
September 9, 2021, 12:32pm
3
Hi @bp777
Please try this,
dt1 - excel sheet1 data
dt2 - excel sheet2 data
Query to find common rows,
dt1.defaultview.totable(false,“Serial Number”).asenumerable.intersect(dt2.defaultview.totable(false,“Serial Number”).asenumerable,system.data.datarowcomparer.default).copytodatatable
Query to find uncommon rows,
dt1.defaultview.totable(false,“Serial Number”).asenumerable.except(dt2.defaultview.totable(false,“Serial Number”).asenumerable,system.data.datarowcomparer.default).copytodatatable
Use write range and write the data back into the excel to check the values.
Thanks
1 Like
bp777
September 9, 2021, 1:22pm
4
Great method. Thank you!
@Srini84 thank you for your help as well.
1 Like
system
(system)
Closed
September 12, 2021, 1:22pm
5
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.