Split_Files_Using_LinQ

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

Hi @Balachander_Pandian

Try this:

dt.AsEnumerable.Chunk(200).Select(Function(a) a.CopyToDataTable).ToList

BlankProcess20.zip (128.1 KB)

Regards

Hi @Balachander_Pandian

Try this

Regards,

1 Like

@Balachander_Pandian

Getting FirstDate and LastDate of Year.zip (2.4 KB)

Output:
SplitExcel.xlsx (41.5 KB)

@Balachander_Pandian

PFB workflow for your reference

BlankProcess20.zip (238.3 KB)

Output:

Regards,

1 Like

Hi @Balachander_Pandian

Output Excel

Split_Input.xlsx (74.6 KB)

1 Like

Hi @Balachander_Pandian

Check the below zip file

BlankProcess20.zip (128.1 KB)

Hope this meets your requirement

Regards

1 Like

Hi @Balachander_Pandian

Output with different sheets
Split_Input.xlsx (74.6 KB)

Hope it helps!!

1 Like

Hi @vrdabberu Thank you so much …It works well.

Hi @Balachander_Pandian

If the solution works for you, please mark my post as solution to help other members.

Happy Automation!!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.