Extract rows encountered between specific rows in excel

Try something like this in Invoke Code activity,

Dim St As String = “string pulled from the textfile suing reader which has key : text I want to keep - end of my string”
Dim pFrom As Integer = St.IndexOf("key : ") + "key : “.Length
Dim pTo As Integer = St.LastIndexOf(” - ")
Dim result As String = St.Substring(pFrom, pTo - pFrom)

Note: “key :” and " -" are the two string of the string’s starting and end which we need to search and get.
we can return the result to the workflow and can use it.

@TwinkleTyagi

  1. Retrieve the data from the 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
    strResult = strContent.Substring(intStartIndex, intLength)

and If have stored data in list then how can we delimitate it on the basis of two values

how to extract the value from string where
input String : “10 11301CD1 2 Irrigation Adaptor, for machine
cleaning, reusable,
for use with Flexible Intubation Video
Endoscopes 11301 BNX and 11302 BDX
Country of origin: EE”

Output String: “Irrigation Adaptor, for machine
cleaning, reusable,
for use with Flexible Intubation Video
Endoscopes 11301 BNX and 11302 BDX”
Where only "Country of origin " string is fixed. Also the length for characters may vary.

You can write a regex expression to retrieve data.

yes tried through “(?=^([0-9]* [0-9A-Z]* [0-9])).(?=Country of origin:)” but getting output produced is "10 11301CD1 2 Irrigation Adaptor, for machine cleaning, reusable, for use with Flexible Intubation Video Endoscopes 11301 BNX and 11302 BDX " since required output is "Irrigation Adaptor, for machine cleaning, reusable, for use with Flexible Intubation Video Endoscopes 11301 BNX and 11302 BDX " .

Get the pattern value "\d{2} [A-Z0-9]* \d{1} " from the result string and replace this result in previous with empty string.