@mohan2mm
You can use the below approach which suits you more.
1. If condition we are checking both line description and total due are exists in pdfextract variable then parse the text using regex we are extracting service details.


Regex used: \b\d+ Service rendered for [A-Za-z]+'[0-9]{2} \d{1,3}(,\d{3})*\.\d{2}\b
2. Another approach is we are just checking whether pdfextract data is starts with "line description" then parse our text.

Thanks,
Deenuji Loganathan 👩💻
Automation Evangelist 🤖
Follow me on LinkedIn 👥
-------------------------------------------------------------------------------------------------------------
If I've helped solve your query, kindly mark my response as the solution ✔ and give it a thumbs up!👍 Your feedback supports future seekers 🚀