Renaming PDF according to specific words inside the PDF

Hi All,

Could you please help me with the following:
I would like to rename a PDF according to specific words inside the PDF. Is that possible and how can I do it?

Thanks in advance!


Welcome to uipath forum

Hope the below steps would help you resolve this

we can use MOVE FILE activity
That is get the pdf files from a folder using a assign activity like this
arr_files = Directory.GetFiles(“yourfolderpath”,”*.pdf”)

Where arr_files is a variable of type array of string

—now use a FOR EACH activity and pass the above variable as input
—inside the loop use a MOVE FILE activity where in the path property mention as item.ToString
And in Destination property mention the
“Yourfolderpath\”+”your new Filename”+”.pdf”

You can get the text from pdf by reading it using READ PDF FILE activity and get the string manipulation done and pass it as new Filename

Cheers @amenoufy

Hi Palaniyappan,

Firstly thank you for taking the time to instruct me. I really appreciate it. I would like to add a question if I may:

  1. If I want the automation to always find the name I want in the PDF (from the very same line/part of the page) for each PDF file, how can I do so? For example, the PDF shows a name in the 2nd line after the word “Name”, is there a formula to make it extract the words after “Name” and rename the file with that result?
    Date: 24/03/2022
    Name: Amenoufy
    Subject: Thank you

In this case the file will be renamed “Amenoufy”

  1. Can I set rules to say, if after “Subject” it says “Thank you”, name the file with the words after
    “name” & add the result “Thank you”. In this example it will rename the file: AmenoufyThankyou

Thanks in advance!