T_Y_Raju
(T Y Raju)
1
i have 2 excel files
in excel file there is address and Abbreviation of the address
and in another excel i have state name and state code
i will be getting input value differtly every time i want to replace the certain address with i put value from excel sheets.
ex- input value is “261st Judicial District Court, Travis County, Texas”
in this input value i want to replace Judicial District Court with JDC from excel sheet
and Texas with TX from another excel sheet.
and if the input value is “31 District Court, Travis County, Ohio”
out should should be - 31 DC, Travis County, OH
i want to check all the values in excels one by one
Address.xlsx (8.9 KB)
States-abbreviations.xlsx (9.9 KB)
@T_Y_Raju
hi
create two dictionary
dict_abbrevations=dt.asenumerable.todictionary(function(x) x(0).tostring,function(r)
r0).tostring)
dict_address=dt.asenumerable.todictionary(function(x) x(0).tostring,function(r)
r0).tostring)
input is “261st Judical District Court, Travis Country,Texas”
pass the value of the input to dict_abbrevation(“Judical District Court”).tostring gives you the value as JDC
T_Y_Raju
(T Y Raju)
3
can u help me sending the work flow
T_Y_Raju
(T Y Raju)
4
is there any other easy method to do?
@T_Y_Raju
Ok iwill share the workflow
@T_Y_Raju
in the excel there need not be duplicates
please remove the dupliactes

make the excel as above
T_Y_Raju
(T Y Raju)
10
input value is “261st Judicial District Court, Travis County, Texas
output should be- “261st JDC, Travis County, TX
that should be the output
[/quote]
@T_Y_Raju

use this in the assign activity as shown below
outputvalue=inputstr.Replace(courtvalue,finaloutput)
T_Y_Raju
(T Y Raju)
12

state name is not changing it should be TX instead Texas
T_Y_Raju
(T Y Raju)
13
State name is not changing
use this at last take assign
coutnryvalue=System.Text.RegularExpressions.Regex.Match(inputstr,“[A-Za-z]+$”).Value
final assign use below
finalstr=inputstr.Replace(courtvalue,finaloutput).Replace(countryvalue,dict_state(countryvalue).ToString)
T_Y_Raju
(T Y Raju)
16
what if the input file has partial match
like Highway Road, District Court, Texas
here it will throw an error ,
output should be Highway Road, DC, TX
@T_Y_Raju
Hi
replace the courtvalue with below assign
courtvalue=System.Text.RegularExpressions.Regex.Match(inputstr,“(District Court)|(Judicial District Court)|(Superior Court)|(Circuit Court)”).Value
@T_Y_Raju
dont copy and paste the code
Please type the expression same as given