Mods.xlsx (10.0 KB)
Master.xlsx (10.1 KB)
I have two excel files MODS and MASTER.
Step 1: I need to open MODS
Step 2: Look for “ID” column in MODS and search them in MASTER
Step 3 : If data is found in MASTER, delete the whole row from the MASTER file.
For example below rows must get deleted from the MASTER file
Please help with this logic, a xaml would be much appreciated, and there can be 500 such rows
Anil_G
(Anil Gorthi)
March 20, 2024, 4:22pm
2
@shikharno.7
You want to directly do it on excel?
If so read the first data into datatble then loop and use find/replace…if found then use delete rows
Else you can read both data into datatable and use linq to remove the data
Cheers
Hi @Anil_G , can you help me with the linq query please?
Anil_G
(Anil Gorthi)
March 20, 2024, 4:26pm
4
@shikharno.7
Use assign
dt2 = Dt2.AsEnumerable.Where(function(x) dt1.AsEnumerable.Any(function(y) y("ID").ToString.Equals(x("MasterId").ToString))).CopyToDataTable
Cheers
vrdabberu
(Varunraj Dabberu)
March 20, 2024, 4:26pm
5
Hi @shikharno.7
=> Read Range Workbook
Output-> modsDataTable
=> Read Range Workbook
Output-> masterDataTable
=> Ue below syntax in Assign:
masterDataTable = (From masterRow In masterDataTable.AsEnumerable() Where Not modsDataTable.AsEnumerable(). Any(Function(modsRow) modsRow("ID").ToString() = masterRow("ID").ToString()) Select masterRow).CopyToDataTable()
=> Write Range Workbook masterDataTable
Regards
@vrdabberu Thanks for taking out the time to answer my query, can you please send the xaml for my reference, please
vrdabberu
(Varunraj Dabberu)
March 20, 2024, 4:29pm
7
Hi @shikharno.7
Sure.
Sequence87.xaml (9.6 KB)
Master.xlsx (10.3 KB)
Mods.xlsx (10.0 KB)
Output has been written in Master.xlsx in Sheet2.
Regards
1 Like
system
(system)
Closed
March 23, 2024, 4:30pm
8
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.