Summary data from Excel Files into one Excel File

Hi Everyone!

I have folder which contains many Source File. I want to read this folder and check one by one excel file and take some data I want and input into the Destination File.

As attached files, I want to take all of item with code “abc” from source files and input into the Destination File as below picture.

How to do that ?

Thanks you so much!
Summary data from excel (18.3 KB)

Hi @trunghai

Use directory.get files(“foldepath”)

For each item in filename
Use read range
Use build datatable activity
Use add data row and pass the variable or row values in datarow

Use write range activity

1 Like

Get list of all files into a list.

fileList = Directory.GetFiles(folderpath)
Loop thru this file list.

  1. Read data into a data table of each excel file using read range activity.
  2. filterData = yourDataTable.Select("Code=‘abc’).CopyToDataTable
  3. Use Merge Data Table activity to merge filtered data table to a new Data Table mergedDataTable
  4. Repeat these steps for all other excel files.
  5. Use Write Range to export the mergedDataTable to a new excel file.

Karthik Byggari


hi Bro @KarthikByggari

Thanks you so much but i do not want to use filter because my actual file very complex and could not filtered.

I want to check if index(i) in Code column contain “abc”… and then it will write the text of index(i) at B Column into the destination file.

I’m doing on my xaml file as attached ^^

Thanks you! Summary File.xaml (6.7 KB)

Thanks you all of you.

I have completed my xaml file
Summary File.xaml (14.4 KB)

1 Like

Sorry I have completed!

Hi @KarthikByggari & @AshwinS2

Sorry bro… If the source file has format as below picture.

I want to check if the row(0).tostring=“abc” then it will get the text in the next row.

If the text at B column on same row with A column, I can used the command “{row(0).ToString, row(1).ToString}” to add data from datatable… but with the data which arranged as below picture.

How to do that ?

Thanks you!

Hi @trunghai

Use add data row with passing array row{row(0). ToString,row(1). ToString}


1 Like

Hi bro @AshwinS2

Could you explain detail for this ?

Thanks you!
Summary File.xaml (14.2 KB)

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