I want to extract the values from below string.
Output have to store into variable
Can anyone please guide me on this?
e.g. Variable Name Value
Subscriber WSD JR, JRSBY
Member ID SGH993246857
DOB Mar 24, 1964
Gender Male
Plan Date Jan 15, 2005 - Dec 31, 9999
String
Edit
Print
WSD JR, JRSBY
Subscriber
Member ID
SGH993246857
DOB
Mar 24, 1964
Gender
Male
Plan / Coverage Date
Jan 15, 2005 - Dec 31, 9999
Hi @vaibhav2.chavan
To give you the best answer possible, can you give me the following information?
- Do you need the text need to be formatted like you write (The \newlines mainly)?
- Is the example text part of a bigger string made by the same format with different Variable Name Value ?
Thank you
@Gabriele_Camilli -
String Variable in which Iβm capturing the data from UI its coming in the below format -
E.g
Edit
Print
WSD JR, JRSBY
Subscriber
Member ID
SGH993246857
DOB
Mar 24, 1964
Gender
Male
Plan / Coverage Date
Jan 15, 2005 - Dec 31, 9999
After that from the above string I want to separate the values and need to be stored in separate variable like below.
e.g. Variable Name Value
Subscriber WSD JR, JRSBY
Member ID SGH993246857
DOB Mar 24, 1964
Gender Male
Plan Date Jan 15, 2005 - Dec 31, 9999
You can use the following Regex to get the variable parts of the text:
-
Subscriber β.*(?=\nSubscriber)β
-
Member ID β(?<=Member ID\n).*β
-
DOB β(?<=DOB\n).*β
-
Gender β(?<=Gender\n).*β
-
Plan Date β(?<=Coverage Date\n).*β
And then just Concat the string to have the wanted result
1 Like
rajanrao1
(Rajan)
5
hi check this xaml file BlankProcess2.zip (18.2 KB)
Hello
I would take a look at this post also if you want to learn Regex for next time 
1 Like