Excel value how to take from datatable

Hi Team i have 2 excel sheets with me
and i have input variable as “721st Judicial District Court, Travis County, Texas”

here in these 2 excel i want to replace Judicial District Court with JDC from Excel sheet
and in the same way i want to replace Texas with TX from States-abbreviations excel sheet. i want to check all the values in excel in both the sheets

both the sheets have 2 columns when the value matches with the input variable i want to assign the value corresponding to that in excel sheet

ex-

Input value is -“721st Judicial District Court, Travis County, Texas”

out put should be 721st JDC, Travis County, TX”

these abbevations are there in excel sheets

here input variable value will be changed everytime. and that value should be checked in excel sheets
Address.xlsx (9.1 KB)
[States-abbreviations.xlsx|attachment](https://forum.uipath.com/uploads/short-
States-abbreviations.xlsx (9.3 KB)

Hi @T_Y_Raju ,

Store the table data from both sheets in 2 different datatbles.

STEP 1 : Use a For each loop, with argument type set to “System.Data.DataRow”, ForEach field keep as row.

In the values Field use the below expression,
DataTableName.AsEnumerable.Where(Function(X) x(“ColumnName”).Tostring().Trim().StartsWith(“Exactvalue which needs to updated”)).ToList

STEP 2: Inside the loop , use an assign activity as below.

To : row(“ColumnName”) - ColumnName same as column used in step 1

Value : string which should be used for updating the existing value , TX

Step 3 : Now inside the data table value matching texas would be changed to tx

You can used the updated data table and over write the data in excel or create new one.

Use the same logic for data table 2 with 2nd sheet data.

If the response helps you out, kindly mark this as solution.

If you face any challenges implementing the above let me know will help you out.

Thanks,
Gautham.