Get the name of a pdf document as text and store as variable

Hello community,

My robot is going to monitor a folder for new pdf documents. Those pdf documents will be grouped in new folders inside that folder.
When a new folder is created, it should get the name of that folder, and store that name as a string variable. Then inside that folder, for each pdf, it should also get the name of that pdf and store that as a string variable. Those files will then be processed later on, and I will be using the stored variables to ensure it is using the correct documents.

Question is, how do I extract the name of the folder/file? I can’t seem to find any activity that does this.

To get an array of all of the files, use System.IO.Directory.GetFiles(MainDir), where MainDir is the directory where you’re expecting new folders to appear. Use System.IO.Directory.GetDirectories(MainDir).

Thanks @Anthony_Humphries. I’m still learning… what activity should I be using that in?

You can use Assign to create an array of directories, and another assign to create another array of files. Then you can iterate over the variables and manage what was found in each.

Hello @JCH,

This might help u…

Pdf_GetNameOfFiles.xaml (5.7 KB)

Regards,
Ojha

Thanks @Avhishek_Ojha that really helped.

Thanks @Anthony_Humphries, I understand what you mean now and was able to use your answer in my solution as well. I appreciate your help.

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