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)
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)
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
=> 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!!
Hi
Input
Output
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.
Thanks bro, its working
Thank you @Parvathy. Its working
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.