Splitting a datatable based on empty row

Hi Team,

I have a peculiar situation where there is a CSV having 3 reports in one sheet separated by 2 empty rows.

Could someone help me splitting them into 3 different datatables.

Thank you.


Hi @Vikranth_FL
Use excel application scope and use select range and based on that you can loop it

Ashwin S

Readin the csv e.g. with readin CSV into a Datatable (dtOrigin)
Then Loop over this with for each row Activity
Use the empty rows as a Marker to detect the begin of the new Report
Within the Markers add the row to the First, Second or third Report Datatable

If you are familiar with linq you can short Cut some Tasks

Have a Look in datatable.clone method. This allows to create an empty Datatable with the Same structure from a source Datatable and Could bei helpfully for you while building the Report datatables in advance

In datatable I have one column in which there are many values like 5.502333 etc… I just want to take round of value like 5.50 till two digit … how I can apply for all values in datatable…

Need ur Help!!

Hi @Addy_619,

Please refer below link … Solution already given.


1 Like