How can split value

  1. I try to split value
  2. CheckNumber variable i want Frist this value “61231279”
  3. CheckDate variable I want only this date “2017-09-27”

“61231279 \r\n2017-09-27 \r\n147326 RON \r\n”

i wrote formula like this

  1. Check_Date.Substring(Check_Date.IndexOf(“Check Date”) + “Check Date” .Length).Split(Environment.NewLine.ToCharArray)(0)

  2. in_CheckNumber.Substring( in_CheckNumber.IndexOf(“Check Number”)+ “Check Number”.Length).Split(Environment.NewLine.ToCharArray)(0)

if this is the input string in a variable named strinput
then
strNumber = strinput.Split(Environment.NewLine.ToArray(),StringSplitOptions.RemoveEmptyEntries)(0).ToString.Trim

this will give us 61231279 as output

and for checkDate
use a assign activity like this
str_Date = System.Text.RegularExpressions.Regex.Match(strinput,“[0-9]{4}-[0-9]{2}-[0-9]{2}”).ToString

which will give us 2017-09-27

Cheers @MONALI_BHALERAO

And
I Want Also this date will split Like in sperate year(2017), Month(9), Day(27)

1 Like

@MONALI_BHALERAO,

You can try with the following method as well,

yourString.Split(vbCrLf, StringSplitOptions.None)(0)
yourString.Split(vbCrLf, StringSplitOptions.None)(1)

The first line will give you the CheckNumber
the second line will give you the checkdate

Thank You Sir

Thank You

then like this
str_Date = System.Text.RegularExpressions.Regex.Match(strinput,“[0-9]{4}-[0-9]{2}-[0-9]{2}”).ToString

once after getting this use this expression to get each and individual variable
str_year = Split(str_Date.ToString,“-”)(0).ToString
str_Month = Split(str_Date.ToString,“-”)(1).ToString
str_Datevalue = Split(str_Date.ToString,“-”)(2).ToString

Cheers @MONALI_BHALERAO

Thank you for solution

1 Like

Cheers @MONALI_BHALERAO

“Client ID: AZ79829\r\nCheck Number: 92195973\r\nStatus: Processed”

i want only this value (92195973) how to remove extra content

1 Like

Hi @MONALI_BHALERAO, use the assign activity, like you did for the other values above and write for value : System.Text.RegularExpressions.Regex.Match(myStringVal,“((?<=Number.).*)”).Value
Don’t forget to replace “myStringVal” with your variable Name. You will get the output “92195973\r\nStatus:Processed”.

Now use another assign activity to split only the numbers out of the string and type in the value field: System.Text.RegularExpressions.Regex.Replace(yourString,“\D”,“”) The Output should now be “92195973”.

For further informations check these posts: Split specifc text - #8 by Arunachalam, Splitting House Numbers with letters - #2 by c.ciprian

Hope this helps! :smiley:

If this is in a string variable named strinput then stroutput will be like this in a assign activity

stroutput = System.Text.RegularExpressions.Regex.Match(strinput,”\s[0-9]+”).ToString.Trim

Cheers @MONALI_BHALERAO

[Client ID: AZ79829
Check Number: 92195973
Status: Processed]

how get status (Processed)

Exacty like this:

Just replace Number with Status