Split on Dynamic Identifier


I am trying to split line item content based upon certain values. This one in particular is a phone number, now I tried using RegEx but it didnt work.

Example is as follows:

Danny Brown
Danny Brown Law Office
12345 Owl Court New York, NY 75222

I want to put each line item into an array so I can reference them later BUT also need all line items except the phone number into one string as I need that for another sequence.

Can anyone help?


Could you precise which Input and wich output you expect ?


Input :

Array of string for each line : Danny Brown
Danny Brown Law Office
12345 Owl Court New York, NY 75222

String variable : 535-523-5252

Thank you in advance

Any update on this query as we also face the same issue.


Please share the input and ouput you expect, then we can work on helping you finding the good pattern to achieve it.

PS: input with several lines


Hi Florent,

Below is the Data which we get from Dynamic CSV as a sample:

PLANO, TX 75093-8185

and I need this in a single string variable. Already tried with Replace, Split options in UI path and I am not able to remove Line break from the data.


Abhash Bhardwaj

Hey @sunnyabhash

You have tried this one as well?

myString.Replace(System.Environment.NewLine, " “)
myString.Replace(”\r\n", " ")

yes i tried it.

Strange… and
this - Regex

Regex.Replace(input, “\r\n?|\n”, " ");

No its also not working, May be its a Line Break which UI path is not able to identify.

@kash i have shared the example can u try to get this in a CSV column and extract the data in one single string.

can u share that csv. because except all of this nothing will be there… because you have just pasted the text if we will use that that it will be handle by System.Environment.Newline easily.

10435197470.xlsx (9.3 KB)
Convert this to CSV.

Hi Sunny,

I understand that the raw data you want to extract data from is

PLANO, TX 75093-8185

Could you clarify what is result result you expected on your variable (string from what i understand?)

It also would also make it easier if you could provide several samples of raw data and the expected result you want.


I just need to remove line breaks from the raw data. I am getting the above data in CSV format. The expected data will be:

6200 W PARKER RD PLANO, TX 75093-8185

in a single string.

Sorry for the delay, Busy day

Please give a try using \n+ as replacing pattern with a replace activity.

From my side it looks fine when it took your excel workbook (not csv)



If not functional let us know.


You can also use an assign activity that way to convert specific “cell” value inside your datatable.

dt.Rows(0)(“Primary Practice Address”) = System.Text.RegularExpressions.Regex.Replace(dt.Rows(0)(“Primary Practice Address”).ToString,“\n+”," ")