Open Specific File in a Folder (Loop through multiple folders)

bbalz

New Member
We have multiple files in a list of folders. Each folder may have 2-6 documents, one of which has specific information on it that needs to be OCR'd to be input into another form.

The document that needs to be opened always starts with the same text but changes later based upon client.

There could be 20 folders in the root directory but each one needs to be opened up individually.

Is there a recommendation of using the directory as a 'list' of folders that the loop would be able to cycle through?

If folder 1 exists, open it, check for file starting with XYZ and open it... OCR step...

Then back to the root directory and check for folder 2, etc etc.

Thanks in advance for any recommendations on the beset way to solve this!
 
In Automation Anywhere, there is a specific loop activity for looping through folders within a folder. There is also a loop activity for looping through each file within a folder. You will need to create a nested loop to go through all of the files within all of the folders. Within the inner loop, you can use activities to open each file and perform the necessary steps.

In version 11, there are system variables that give you access to the file and folder names within the loop. In A2019, you can specify a variable to contain the file/folder names.
 
Top