To extract values between two strings of text

@mhk15

  1. Retrieve the data from pdf file. This will be assigned to a string variable strContent
  2. Find index of the text from where the data need to be copied. Consider your search text is saved in a string variable strStartSearchText and index is stored in an integer variable intStartIndex
    intStartIndex = strContent.IndexOf(strStartSearchText)
  3. Find index of the text where the data copying should be stopped. Consider your search text is saved in a string variable strEndSearchText and index is stored in an integer variable intEndIndex
    intEndIndex = strContent.IndexOf(strEndSearchText)
  4. Find length of startindex to endindex and assign it to an int variable, intLength
    intLength = intEndIndex - intStartIndex + 1
  5. Find substring of the text. Consider your resultant data will be assigned to a string variable strResult and it contains the entire table data
    strResult = strContent.Substring(intStartIndex, intLength)
  6. Now generate a regex template to match every line items.
  7. Use “Matches” activity to retrieve all the line items.
  8. Loop through the result, use string manipulation methods to retrieve column data.
3 Likes