Hi I am fairly new to UiPath and trying to remove certain sentences from text file, these are fixed sentences and occur at different instances.
Examples:
Eg1- Securities Settlement Instructions
Eg2- H.I. Testing Page 1 of 17 December 2, 2019Testing Instructions - for Prime Finance Clients of
U.I Securities LLC.
Registered Address: 383 Madison Avenue, New York, NY 10179
I tried to use replace activity but its giving me blank output.
Hi @abhishek.singh4 ,
Thanks for reaching out to UiPath Community.
You can use Regex for extracting the text you want. Please try this solution once.
Variable1 = System.Text.RegularExpressions.Regex.Replace(textContent, “Securities Settlement Instructions”, “”)
Variable2 = System.Text.RegularExpressions.Regex.Replace(textContent, “H.I. Testing Page 1 of \d+ .* Testing Instructions - for Prime Finance Clients of.* U.I Securities LLC.”, “”)
Also keep in mind:
ensure that the sample input text also have more sample text as the replacement part.
We can see that input and pattern starts with Securities. When the same is also at the end (input text ends also with the same pattern end), then the empty result string is reasonable
Another regex sample for the second case jandling properly dot and line break as . is excluding a linebreak char (\n)