how to extract data between two different strings of text file if text file is stored in list of UI path. As line item is required to be extracted…
you can use for each activity to go through list.
@mhk15
Can you please send a xaml with the input data and explain what you really looking as output?
this pdf is converted into text then I have applied string operation to extract data that starts with " Pos. Art.no. Quantity Description Unit price Total EUR" and ends with “Goods supplied in accordance with our General Conditions for the Sale and Supply of goods as published on”. I have shared my XAML file also. but I’m not able to extract that particular portion… please help me to pocess21.2(list items).xaml (6.9 KB)
- Retrieve the data from pdf file. This will be assigned to a string variable strContent
- 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) - 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) - Find length of startindex to endindex and assign it to an int variable, intLength
intLength = intEndIndex - intStartIndex + 1 - 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) - Now generate a regex template to match every line items.
- Use “Matches” activity to retrieve all the line items.
- Loop through the result, use string manipulation methods to retrieve column data.
thanks… could you please share a XAML file?
You might have created two variables with same name but with different scopes and you are assigning value into one and using the other somewhere else.
When you have your text extracted, you can find the bit you want with the following regex expression inside the “Matches” action.
“(?<=” + labelBefore + “)” + “(.*)” + “(?=” + labelAfter + “)”
Where the labelBefore is a string preceeding the wanted bit and the labelAfter is a string following the wanted bit.
Is this helpful?
any other way??
But I have stored my file in an array of strings but I am not able to find index of that particular string.
The search string should exactly match the content in the array.
Since not able to find index of string present in text file so not able to extract the required text also. could u please share any of the XAML file which will be doing the same task. index of fixed character are easily extracted. But here we have to access a text file and find string in that text file
try using instr method
In assign activity
index storing variable =instr(Bigger string variable, searching variable)
this will return searching variable index number in the Bigger string
I am trying same but I got error as “StrIndex cannot be less than zero”…
I have posted on exact question on following link. Please check it.
Can you please provide your workflow and input file?
I want to fetch the data “100$”
So I developed above logic.
I got above result. But I just want 100$.
@Jayesh_678
Use Matches activity, and set below properties-
Input - The extracted data from pdf
pattern -
From the result, take first record.