Extract/Splitting the particular data from entire data

Hi Team,

Input:

Name: 10-04-23_Time_02_11_06_22-02-23_Time_10_02_04_DR File Voluson SPC330 Consoles-Test.xlsx Id: 1189425113869 Type: file Uploaded Date: 04/13/2023 06:00:13 Modified Date: 04/13/2023 06:00:13

Output Required:
10-04-23_Time_02_11_06_22-02-23_Time_10_02_04_DR File Voluson SPC330 Consoles-Test.xlsx

Thanks
Likitha

Hi @vinjam_likitha ,

Use the following expression:

System.Text.RegularExpressions.regex.Match(TextVariable,"(?<=Name:)(.*(.xlsx))").groups(1)

image

Regards,

Hi @vinjam_likitha

Can you try this RegEx:

^(?:Name: )?(.*\.xlsx)

image

Hope this helps,
Best Regards.

HI @vinjam_likitha

Checkout this expression

System.Text.RegularExpressions.Regex.Match(inputString,"(?<=Name:\s).*(?=Id:)").Tostring

Regards
Sudharsan

Hey @vinjam_likitha ,
Try this if the pattern is same for all of the inputs.

Split(YourInputVaribale," Id:")(0)

Output :
image

Regards,

1 Like

Hi

The output of it should be stored in one variable. what is the data type of it.

You can store it in a string variable. @vinjam_likitha

it is throwing an error.System.string cannot convert to system.regularexpression.group(1)

Hi
In this Split i think you missed Name which is in input

@vinjam_likitha , Add .value.tostring at the end :

System.Text.RegularExpressions.regex.Match(TextVariable,"(?<=Name:)(.*(.xlsx))").groups(1).Value.ToString

Regards,

@vinjam_likitha ,
Please try this,

Split(Split(YourInputVaribale,"Name: ")(1)," Id:")(0)

Regards,

Can you try this-

  1. Add a “Matches” activity to your workflow and set the “Input” property to the input string.
  2. In the Properties panel of the “Matches” activity, set the “Pattern” property to the regular expression \bName:\s+(.+)\b.
  3. Add a “For Each” activity to iterate over the resulting collection of matches.
  4. In the “For Each” activity, add a “Write Line” activity and set the “Text” property to item.Groups("1").Value. This will extract the captured group from the current match and print it to the Output panel or a log file.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.