Extract key term and Identify the page number it is on

Is there a way to read a pdf file, extract a key term you search for, and then also list what page number it is on to an excel file. For example, search for term “Total Balance” then for each match, write to an excel file the key term found and page 1, page 3, and page 4. So in this case there would be three matches and three rows in an excel file showing the balance and the page it was from.

@gregelliott You can do it by finding number of pages in PDF file and then loop through each page using while loop and after reading check the keyword you required present in the page, based on boolean value you can either add value to value excel or go to next page.

@Manjuts90 thank you. And how would you count the number of pages? There are not words on the each page showing “Page 2” or “pg 3” or even numbers at the bottom noting each page. Can uipath recognize where each page is like adobe acrobat does on the top showing 1 of X?

@gregelliott Check below thread below for counting page numbers in pdf

Extracting pdf page count without using regex