From above all data i want split each data and assign to variables like
ex: Name: Mr Soot Princeer
Ref no.: 73236SE023
Stays: 3
pls provide solution .Tq
hello @lakshmi_narayana_ch you can split the information on the basis of space , suppose str_var =“Mr Soot Princeer 73236SE023 3” . Create array of string type str_array , and assign the value to the array of string type = str_array = split(str_var," “)
Now str_array have =[“Mr”, “Soot” , “Princeer” , “73236SE023” , “3” ] then do create a variable of struing data type example name and then do this name = str_array(0).ToString +” "+ str_array(1).ToString + " "+str_array(2).ToString
and extract information from the array according to your requirement.
I extracted basic data(Mr Soot Princeer 73236SE023 3) using matches activity and iterated using for each. if i assign variable to extract individual data it is showing error that not accepting to convert string to int. Now how can i use your expression and extract individual data.
My expression is to be used in assign activity…and you have to give your string in place of str…basically it would be currentitem.value…and in for each properties change the type argument to system.text.regularexpressions.regex.match
Maybe we can use the Split function as well, if the Ref No. and Stays are always in the last positions. As mentioned by @Ankit_Chand , but in a dynamic way we can use the below :
An additional check on the Split to see if there are 3 or more splits would be necessary at first, then the extraction part as provided above could be done :
Split(yourInputStr.Trim).Count>=3
Let us know if you are able to understand the above approach.