Reading data from on excel file and transferring it into another excel file

Hi Team, I have a use case wherein, I want to first read data from an Excel file ( Base file) and transfer it to another Excel file ( master file)

The issue is the master file has fixed columns, whereas the base file will always be dynamic and the columns could vary, the order of the columns could be different as well, but the Column’s Names are constant.

The desired outcome is to transfer data from the base to the master file, and pass null/blank values to columns in the master file in case a column is not present in the base file, but it is present in the master file. TIA!

hello @Raghav_Dhawan
May i know how much columns do you have more than 10 or less.

Hi @Shubham_Kinge , the base file could have columns up to 32, but the master file has fixed no of columns, i.e. 12. Thank you!

FIrst read range from master. Take the columns as array. then put that columns in for each loop create dictionary(of String, String) and add the key as array’s string and value as if data present provide value else put “”.
after that put all dictionary values into the add datarow providing array of dictionary values.
If you want i can provide you dummy code.

Thanks a lot, @Shubham_Kinge, the dummy code will be really helpful, actually I am pretty new to UiPath StudioX

I am creating with studiox. but i dont have that much idea about studiox. so it will take time. please be patient. i know about studio only.

Sure @Shubham_Kinge , Thanks a lot for the help here

MergingInMaster.zip (66.8 KB)
Check this one. first thing its my first project in UiPath studio x. just understand the logic. i have mastry in studio.
If some mistake please ignore

Hi @Raghav_Dhawan

  1. Read the Base File: Use the “Read Range” activity to read the data from the base file into a DataTable variable. This will capture the dynamic column structure of the base file.
  2. Read the Master File: Similarly, use the “Read Range” activity to read the data from the master file into another DataTable variable. This will capture the fixed column structure of the master file.
  3. Transfer Data: Iterate through each row in the master DataTable and check if the corresponding column exists in the base DataTable. If it does, transfer the value from the base DataTable to the master DataTable. If the column does not exist in the base DataTable, set the value in the master DataTable as null or blank.

Thanks!!

HEllo @Raghav_Dhawan
Please Reply or mark it something as solution. dont keep thread open.
Thanks and regards

Thanks a lot @Shubham_Kinge for sharing this, it looks like my IDE has some insufficient resources, therefore, I am not able to open the project.json in my system.

Thanks @Nitya1 for sharing the flow , I was trying to build something on similar lines and it seems to be coming out well.

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