Hi @naveen.s
Follow the below steps to achieve solution,
β Use the Get PDF Page Count activity to get the count of pages of pdf. Store in a variable called PdfPageCount.
β Then use the For each activity to iterate the each page number, in For each give the below expression, output of For each is currentNumber
Enumerable.Range(1, PdfPageCount)
β Inside for each insert the Read PDF Text activity and open the properties, give the currentNumber.toString in Range field. Create a variable in the Text field as EachPageText.
β After that use the If activity and give the below condition,
currentNumber=1
β Inside then block insert an assign activity and create a variable called FirstPageAccountNumber then write regex expression as below,
- Assign -> FirstPageAccountNumber = System.Text.RegularExpressions.Regex.Match(EachPageText, "CIF\d{12,14}").value.toString
β After If activity insert one more If activity to check below condition,
System.Text.RegularExpressions.Regex.Match(EachPageText, "CIF\d{12,14}").value.toString.equals(FirstPageAccountNumber)
β Create a boolean datatype variable called Bool_MatchAccountNumber
β Inside then block insert an assign activity and assign boolean variable as True.
- Assign -> Bool_MatchAccountNumber = True
β Inside else block insert an assign activity and assign boolean variable as False.
- Assign -> Bool_MatchAccountNumber = False
β After assign activity insert the Break activity to break the loop.
After loop bot will come outside of For each. Then check the boolean variable output Bool_MatchAccountNumber, if it is True then account number in all pages are matched else not matched.
Check the below workflow for better understanding,
Hope it helps!!