Dividing single excel file to Multiple Subfiles

Hi Team,

I have one input file for Example with 50 records(its is dynamic) i want to extract every 10 records(it also dynamic) some times i need to extract 5 records or 8 records based on user request it depends and copy it in to another excel files

and excel file names should be
for Example main input fileName is ABC then Subfiles name should be same with ABC_1,ABC_2,ABC_3,ABC_4 etc added at the end of the file name

Input FIle:
Abc qpr DR File abc.xlsx (10.6 KB)

HI,

Can you try the following sample?

dt.AsEnumerable().Skip(CurrentItem*chunkSize).Take(ChunkSize).CopyToDataTable

Sample20230404-6L.zip (10.8 KB)

Regards,

1 Like

Hi @Yoichi ,

What if my main file row count is 5 in the above logic

Hi,

It creates single file which has 5 rows.

Regards,