Merging data from dynamic excel files

Hi there.

I have a project that i have to merge daily data from excel files that are in sub-folders of a folder named “Filename_dd_mm_yyyy” into one (without repeating the next day) to copy all that data into a excel macro.

im building a datatable by making a loop within a loop to get the files, but writing row by row.
ive tried searching various topics about this subject, tried read/write range, merge datables, but i cant seem to replicate the first result

someone advised me to use add.datarow{var1, var2, varN…}

can some help? thank you

build datatable DT2
assign getsubfolder=directorey:get:directory
for each item in GetSubFolder
assign folderPath = getSubFolder.ToString
assign GetFileFromDir= directory:getFiles
for each GetFilesFromDir = directory.GetFiles
write line item.ToString
excel app scope read range sheet1
for each row row in DT1 add datarow
write range DT2
(couldnt upload file)

@adiogopaiva

If you want to add the data into one data table row by row… Then continue with merge data table but only if all the column are same in all the file…

My solution is as below
For each files in a folder do the fol
1 Read excel file one by one
2 Append the data into an temporary excel

— After all the files get over then read the temporary excel file
— Use the data how ever you want to use

Regards
Ajay

Hi @adiogopaiva,
The following workflow should help:mergeDT.zip (19.9 KB)

Hope this helps

now i can.
i want only read/write range instead of each row (to speed up the process, since every file has the same number of columns) and only the files of the present date (filename_dd_mm_yyyy) that are placed in multiple sub folders of a folderGet Files From all Folders.xaml (17.4 KB)