UiPath OCR Data Extraction into Excel

I need help in creating a sequence where I have 5 scanned invoices in a folder. In each image, I need to extract “Invoice Number”, “Date” and “Customer ID” which are in unstructured format. I’m okay with using any OCR engine as long as it can fetch me the above information in text format and finally send it to Excel Workbook.

Uploading sample image:

I’ve used “For Each” in other projects to write to Excel, but in this case I can’t seem to wrap my head around it.

I also tried to use ‘Get OCR Text’ activity to convert the entire image into text and then find relevant text in that output but got stuck there too. Also tried my hand in Screen Scrapping but that will need manual intervention for each image and would defeat the purpose of automation in a folder full of images. If someone could share the project file here on how to do this then it would be great. Thanks!

Is the file you’re trying to read an image (like the one you’ve posted)? If not, can you upload the PDF and the workflow you’ve created so far? I think you’re on the right track using Get PDF Text if this is a native PDF.

I’m not using a PDF, the image uploaded above is the one which I am using. Here, let me upload another similar image which I use.

All I need is to convert the image to text and fetch those 3 parameters and send it to Excel. This process needs to be done to all images in a particular directory.

For example, let say I have 4 scanned images like the one’s I’ve uploaded so far in a directory, I need to build a sequence to fetch only ‘Invoice No’, ‘Date’ and ‘Customer’ from all images and send it to Excel.

This will do the trick, supposing you do not have any other formats to your sheets. I only tested with the 2 you provided.

Processusvierge.zip (837,9 Ko)

Mate, you are a Genius! It worked like a charm, I added the remaining images to the directory and the sequence transcribed all of it.

I swear this will be my last request here, could you also show me how to push those 3 captured data into an Excel Workbook. Tried to use ‘Build Data Table’ and ‘Write Range’ activity but the file never gets the data. Thanks!

If you already have the data you need in string variables, you will only need either an excel scope that will create or open existing excel sheet, and then you can use write cell to write the values. If you have a data table with all values then you will use Write Range instead.

As bcorrea said, you can use Build Data Table to load in the variables, then after the loop is done, write the range to a file.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.