Split House Numbers and street address

Hello Friends,

I want to split address into 2 columns as shown in screenshot.
Please provide solution in different methods.

Thanks in advance
challenge_Split string and numbers.xlsx (12.4 KB)

@Jeeru_venkat_Rao

for each row in datatable activity

inside use

2 assign activity

Currentrow(“Numbers”)=system.text.regularexpression.regex.Match(Currentrow(“Address”).tostring,“\d+”,“”).trim

Currentrow(“String”)=system.text.RegularExpressions.Regex.Replace(Currentrow(“Address”,“\d{2,}”,“”).trim

cheers

Hi @Jeeru_venkat_Rao

=> Use Read Range Workbook to read the excel and store it in DataTable say dt_data
=> Use For Each Row in Data Table to iterate through data table and give the below syntaxes in assign activity:

Address= CurrentRow("Address").ToString
CurrentRow("Numbers")= System.Text.RegularExpressions.Regex.Match(Address,"^\d+").Value
CurrentRow("String")= System.Text.RegularExpressions.Regex.Match(Address,"(?<=^\d+\s).*").Value

=> Use Write Range Workbook to write it back to excel.

Check the below zip file for the workflow for better understanding.
Sheet1 is the input and Seet2 is the output which is in your required format.

Forum Question.zip (53.6 KB)

Hope it helps!!

@Jeeru_venkat_Rao

forumsplit.zip (3.1 KB)

cheers

Hi

Input
image

Output
image

Workflow

Xaml
Sequence.zip (1.7 KB)

Code
dtOutput

(From rows In dt.AsEnumerable
Let a =  System.Text.RegularExpressions.Regex.Replace(rows("Address").ToString,"\d","").ToString
Let b =  System.Text.RegularExpressions.Regex.Replace(rows("Address").ToString,"\D","").ToString
Select dtOutput.Clone.Rows.Add((String.Join("^",rows.ItemArray)+"^"+b.ToString+"^"+a.ToString).Split("^"c))).CopyToDataTable

Thanks,

Thank you everyone for your response.

1 Like

Thanks bro, its working

1 Like

Thank you @Parvathy. Its working

1 Like

Thanks @RajKumar_DC for your response. I will try this one as well.

You’re Welcome @Jeeru_venkat_Rao

Happy Automation
Regards,

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