Data from PDF to Excel

First post here! :slight_smile:

Given that this is the data, and we want to input it into Excel (in table form).

Is it possible to perform it on UiPath? If yes, how can I do it?
Please advise!


Welcome to the community

Two ways

  1. Try using read odf text and check if you are able to get differencebetween check and uncheck boxes then you canuse regex manipulations to extract the data nd putit into excel
  2. If 1 does not work thenyou need to go with document understanding and train a model to extract the required data


hi, thanks for your reply
I tried using read PDF text but it could not differentiate between checked checkboxes and those that are not checked.

so i guess i will proceed to method 2? can you explain what you mean by training a model to extract the required data? how do i do it


For this you need ai center access…I hope you have it…and you are on enterprise license…

Go to ai center…create a project…upload yourfiles and label them and then train a model

For a starter please go theough ai center videos on academy…apart from that here are few resources


i am testing out the write text file function.

because this is for loop, i want it to write to a different text file as it iterates through the loop. so, what should i put under “Write to filename”?

Please advise, thanks!


You can make “test123.txt” a variable instead and assign a new value before the Write Text File activity. Example: variable name strFilename and assign "test" + intIncrementalValue + ".txt" where intIncrementalValue increases either by you adding 1 each loop or using an index of some kind.


do you mean by this? why is there an error?

@JwK Hover your mouse on the red circles and it will show you the exact error message.



oh i see. it shows intIncrementalValue is not declared. though i have added variable strFileName = “test” + intIncrementalValue + “.txt” in the variable manager.
which part did I do wrongly?

@JwK Decalre intIncrementalValue in the Variable Manager and give it a default value of 1. Don’t forget to add an Assign activity after writing the file. intIncrementalValue = intIncrementalValue + 1

thanks for the explanation, @argin.lerit
I am new to UiPath and still in the midst of exploring…

this is what i have currently
for each file in Directory.GetFiles(strPath), where strPath is the folder path.
in the body, i have read pdf file followed by assigning intIncrementalValue = intIncrementalValue + 1 and i have already set intIncrementalValue = “1” at the variable manager.

also, in the variable manager, i assign strFileName = “test” + intIncrementalValue + “.txt” and i use write text file, where i have strFileName under “Write to filename”

any of the steps are incorrect?

it gave me this error

@JwK That’s an issue with the PDF format. If you have other files you can use for testing, try to use those first and see if you get the same error


i tried using other test files. same error…
but are my codes correct? or do u need to see pictures of it for better understanding?


Can’t tell right now if the rest of the code is correct but what I know is that you need to find another approach to reading the PDF as the current one is not compatible right now with your files.

Maybe choose a different OCR engine or go the AI Center route if you have that in your organization. Let me know what you end up trying

@argin.lerit i have used the same PDF files for other testing. it works, not sure why it doesn’t here.

i only know of read PDF function. what are other ways to read a PDF?

If you have not tried Read PDF with OCR yet, give it a go, there’s a couple of OCR engines to choose from


Or this if your organization has it: Intelligent Document Processing - Document Understanding | UiPath

@argin.lerit tried read pdf with OCR with different engines. didn’t work too…
frankly speaking, i don’t think problem lies with pdf though i’m not sure why that error shows up. as i have been that test file for my previous few runs.

when you use the assign activity, eg. strFileName = _______
should the blank be always written in quotation marks?

do you have a sample pdf? have you tried regex manipulation? you can test it as workaround instead of using PDF activity.

In most cases, yes. As in strFilename = "LogMessage.txt"
You can also pass the value from another variable like: strFilename = strAnotherVariable
Or combine like this: strFilename = "LogMessage" + intCounter + ".txt"

You can learn more about String manipulations here: Basic String Manipulations in .NET - .NET | Microsoft Learn