I have a business need to split a the string content of a txt file. The content of the file is
I want to split it on the word “SUCCESS” so the content should now look like either :
OR
I have looked at similar issues, but I have not found one that actually did address my issue. I have attached a workflow that I was using here. While I try to see if I can get it to work, I would appreciate help.
substringAStringUsingAWord.zip (3.3 KB)
rikulsilva
(Henrique Lima da Silva)
December 12, 2023, 10:16pm
2
Hi @Yomi_Oluwadara
You can try this regex in For Each Activity
System.Text.RegularExpressions.Regex.Matches(readFile, "\{([^}]*)\}")
Change the argument type to
System.Text.RegularExpressions.Match
Cheers
1 Like
Yoichi
(Yoichi)
December 12, 2023, 11:41pm
3
HI,
Another approach: regex pattern "{[^{]+" also helps you. This returns the first result.
Or, if you need to extract each value, the following will help you.
"{""(?<TYPE>.*?)"":""(?<CONTENT>.*?)""}:(?<STATUS>[^{]*)"
Sample
substringAStringUsingAWordV2.zip (3.7 KB)
Regards,
@rikulsilva Thanks! That was a good approach!
@Yoichi Thanks a lot! the solutions were awesome, thanks for the education.
1 Like
system
(system)
Closed
December 16, 2023, 2:47pm
6
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.