Iterating Over Multiple Datatables

Hii,
I have Multiple files in a folder
I need to iterate to a files and store it in a datatable.
While its iterating over 2nd file, Whatever the values of 1st datatable are there I m getting the continuation in the second datatable and so on for the rest of the other files.

Like for example
1st File having data
12
23
45

2nd File having data
56
78
910

While iterating through 2nd file the value of datattable should be only
56
78
910

But I m getting
12
23
45
56
78
910

Please help how to handle this in a datatble

Hi @Doonline

hope this link is helpful Append one datatable to another

Hi!

use build data table(Columns which you wants to see as output) and create columns then read the excel (Sheet2) then take one for each row in dt and use add data row and inside the array of row {currrntrow(“column1”).toString,currrntrow(“column2”).toString} dt as builddt output. take one write range and mention dt as build dt output

Regards,
NaNi

Bro I dont Want To Append it.

Hi @Doonline ,

From the example what i understood, in the end of iteration just use a clear datatable activity and pass the datatable name.

Thanks,
Shikhar

I just Need to read the file and save it as a datatble but I dont want continuation of 1st dadatable while iterating to a 2nd datatable

Yes! the above approach will work in this case.

Regards,
NaNi

ok Bro

what you can do is after you completed you task with 1st datatable saved in a variable lets say DT_Excel, you can assign DT_Excel = Nothing.
This should work

Thank You So Much

1 Like

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