Hello,
I am using “Read PDF” to extract a certain paragraph between 2 lines of text, which I have done. The output is a large string that looks like this:
a) information a
b) information b
c) information c
d) information d
e) information e
I’d like to regex or split/substring in an array that looks like this:
Array(0) = a) information a
Array(1) = b) information b
Array(2) = c) information c
Array(3) = d) information d
Array(4) = e) information e
you can use the following steps to achieve the desired result:
Use the “Read PDF Text” activity to extract the text from the PDF and store it in a string variable, let’s call it pdfText.
Use the “Matches” activity to extract the paragraphs using a regular expression pattern. In UiPath, you can use the System.Text.RegularExpressions.Regex.Matches method with the following pattern: (?<=\n)\w+\) .+. This pattern will match each paragraph that starts with a letter followed by a closing parenthesis, and extract the entire paragraph.
Loop through the “Matches” result using a “For Each” activity, and add each match to an array or list variable