Please help me with the following scenario, as I am unable to find proper solution to it.
Scenario:
I have below type of files to map:
a) CSV File : It has lots of columns and rows
b) Excel File : This is a standard file template with columns (columns name are different from column names in CSV file)
Now for a specific condition - if column (Case_ID_ Count) in CSV file has data as 1, i need to map data from specific columns in CSV file to specific columns in Excel File as below:
What I have done uptil now:
Step 1: Used Read CSV activity to read data from csv file and converted it into datatable - lets say DT1
Step 2: Used Read Range to read Excel file into datable - lets say DT2
Step 3: Used “For Each” rows in DT1 and inside For each loop used “If Activity” with condition as - row(“Case_ID_ Count”).ToString.Contains(“1”)
Now I am stuck as i am not sure how to map the data…Please help as I am pretty new in Uipath Or Development
to be more specific:
Split your data table in two tables. one with the flag Case_ID_ Count == 1 and the remaining entries.
Join or replace your values in the first table.
At the end merge both tables back together.
(from x In dtPeriod.AsEnumerable() where (From a In dtPeriod.AsEnumerable() Join b In dt_calandar_datatable1.AsEnumerable() On a(“column3”).ToString Equals b(“Date”).ToString select a).Contains(x) select x).CopyToDataTable()
Now for matching city column in excel template with another excel’s Location - Column, and if City = Location, get data from RI No column in the other excel to LOcation_RI column in Excel Template,
Just guessing: the DataTable for Write Range is empty.
I think the join command is wrong. You have to set in the join only the matching columns (e.g. a personal number which exist in both tables and combines both tables). Like NSLookup in Excel. And then you can remove the old columns and rename the freshly joined columns.
That’s right. Having a doubt if Join DataTable activity is right for this scenario.
As in the scenario - need to fetch data from the CSV file which has it’s unique columns and put data in Excel Template with it’s own unique columns
Its basically, there’s no common columns between the two files, we need to get data from specific columns in CSV file and put them in predefined columns in the excel template
Example:
In DT 2 (CSV File) there’s column name = Service_Order_ID
and in DT1 (Excel Template with just columns & blank data) there’s column name = CSOItemKey
Now, how to fetch data from DT2 column " Service_Order_ID" to DT1 Column “CSOItemKey”?
Step 1 - Filtered Data in source file as per condition using Filter Data Table activity
Step 2 - Renamed Column name of filtered DT as per Excel Template Column Name using Assign activity (Datatable.Columns(“Old Column Name”).ColumnName = “New Column Name”
Step 3 - Write the data table with renamed column name into excel file 3
Step 4 - Used Merged Data Table Activity to Merge Excel File 3 and Original Excel Template
Step 6 - Used Join activity to get Location code based on City column in Template