How to teach robot to find a specific information in text?

I want to teach a robot to take information from the invoice to fill it in windows aplication for accounting purposes. For now, the robot converting pdf into text file quite well. I`m looking for some advice/ideas how to make robot to understand where is in the text file name of company, name of service, vat number, companys reg. number and so on…

txt file looks like this:
SIA „Gym LV“
Gustava Zemgala gatve 71, Rīga,
LV-1039hello@lemongym.lvReģistrācijas Nr.: 40103878721
PVN maksātāja reģistrācijas Nr.:
LV40103878721RĒĶINS NR 49970/R/12/202020-12-04Pārdevējs:SIA „Gym LV“
Gustava Zemgala gatve 71, Rīga, LV-1039
Reģistrācijas Nr.: 40103878721
PVN maksātāja reģistrācijas Nr.: LV40103878721
Norēķinu konts: LV14RIKO0000084391308Pircējs:Nikita Vologdins
Skolas iela 67 - 41

How do you think is to use regular expression is a good idea?
Thank you for your attention.

Hi,

Regexp matching should work nicely. You can either use Python (e.g. re module) to perform that or work with Robot Framework String library. It’s a common pattern to use regexp along with OCR or other similar text extraction method.

/Antti

1 Like