Split on Dynamic Identifier


#1

Hello,

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
535-523-5252

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?


#2

Hello,

Could you precise which Input and wich output you expect ?

Example

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


#3

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


#4

Hi,

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

Cheers


#5

Hi Florent,

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

6200 W PARKER RD
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.

Regards

Abhash Bhardwaj


#6

Hey @sunnyabhash

You have tried this one as well?

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


#7

yes i tried it.


#8

Strange… and
this - Regex

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


#9

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


#10

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


#11

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.


#12

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


#13

Hi Sunny,

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

6200 W PARKER RD
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.

Cheers


#14

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.


#15

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)

image

image

If not functional let us know.

EDIT :

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+"," ")

Cheers