How To Make For Each Row Faster?

This program aims to read data from an Excel file containing data that will be divided into several parts (chunks) based on date, taking into account the maximum size for each part. After the data is shared, each part will be stored in a DataTable separately and then saved into a collection arrDT = List(Of DataTable).

If the current data has the same date as the last data in the arrDT collection, and if there is still space in the last DataTable to add a new row, then the current row will be added to the last DataTable.

If there is no space left in the last DataTable or the date is different, then a new DataTable will be created and the current row will be added to that DataTable. The new DataTable is then added to the arrDT collection.

After the iteration is complete, each DataTable in arrDT will contain the separated data sections.
If needed, each DataTable in arrDT can be saved to a separate Excel file.

The rows is 20.000 and soon up to 100.000+
How to make it faster? I already wait an hour

@Enrico_N_F Can you just share the input and the output file or a screenshot of it for better understanding of your question?

@Enrico_N_F

Did you happen to try uaing linq?

It can be little faster…also in debug mode it might be little slow…sid you try in run mode? Or from orchestrator?

Cheers

Instead of debug mode and do run file and check.If you are running in debug mode it runs little slow

thank you it solved!

1 Like

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