Hi Expert,
I have an Excel file with 1319 line items. I need to split multiple files with 200 line items each with the same header. How can achieve this by LINQ. Attached input file for your reference.
Regards,
Balachander
Split_Input.xlsx (43.4 KB)
@Balachander_Pandian
Do you want split total line items into mutiple datatables having 200 line items each
dt.AsEnumerable().Chunk(200).Select(Function(a) a.CopyToDataTable()).ToList()
gives output as list of datatables
vrdabberu
(Varunraj Dabberu)
March 1, 2024, 5:35am
3
Hi @Balachander_Pandian
Try this:
dt.AsEnumerable.Chunk(200).Select(Function(a) a.CopyToDataTable).ToList
BlankProcess20.zip (128.1 KB)
Regards
rlgandu
(Rajyalakshmi Gandu)
March 1, 2024, 5:37am
5
lrtetala
(Lakshman Reddy)
March 1, 2024, 5:46am
6
@Balachander_Pandian
PFB workflow for your reference
BlankProcess20.zip (238.3 KB)
Output:
Regards,
vrdabberu
(Varunraj Dabberu)
March 1, 2024, 5:52am
8
Hi @Balachander_Pandian
Check the below zip file
BlankProcess20.zip (128.1 KB)
Hope this meets your requirement
Regards
Hi @Balachander_Pandian
Output with different sheets
Split_Input.xlsx (74.6 KB)
Hope it helps!!
Hi @vrdabberu Thank you so much …It works well.
vrdabberu
(Varunraj Dabberu)
March 1, 2024, 11:31am
11
Hi @Balachander_Pandian
If the solution works for you, please mark my post as solution to help other members.
Happy Automation!!