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!
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.
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
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.
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.
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 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.