cancel
Showing results for 
Search instead for 
Did you mean: 

Transferring files to Specific folder

BarryBell
Level 4
Hello, I have a task that is conceptually easy but I seem to be missing some "how-to knowledge" and cannot find a solution from training or on youtube.
Task: Move .pdf files from one folder to targeted or specific folders.

I have no issues moving all of the files to a folder but that is not my task.

I used an action stage to "get files" and loaded the names of the files to a queue. I was then going to use "Get next item" in the queue and "move files" one by one to the targeted folder. Each file name needs to be matched to a folder with the same name. ( I was told there would be exceptions where they do not match exactly)

I need help with how to tell the bot to grab, for example, "Test1.pdf"  and move that file to a subfolder named "Test1"  then get the next item and repeat until all files that have a matching folder name are moved.

This seems simple but I am missing something.

21042.jpg


------------------------------
Barry Bell
RPA Manager
DHGLLP
America/New_York
------------------------------
3 REPLIES 3

GopalBhaire
Level 10
1. Trim out extension from filename as save in temp dataitem.
2. Do Get Folders on you 8886 File Transfer test 2
3. Loop over result of 2
4. Decision temp=Folders.Name
    if yes Move File to Folders.Path&"\"&filename and connect back to step 1
    if No Next
5. To end of loop you can log exception and move back to step 1.

------------------------------
Gopal Bhaire
Analyst
Accenture
------------------------------

Gopal, thank you, I feel like a bonehead. So simple.

------------------------------
Barry Bell
RPA Manager
DHGLLP
America/New_York
------------------------------

Carl__Carter
Staff
Staff
Hi Barry,

You would build your Destination Path which is used in the Move File Action, using the original file name (dropping the original file type extension). To do this, you will need the data from the Name column and the Extension column of the Collection containing the output from the Get Files Action.

Example:

Assuming your Get Files Action stores the output in the Collection named Files

The destination base folder is C:\Test\.....

Your Expression for the Destination Path input in the Move File Action would be:

"C:\Test\" & Replace([Files.Name], [Files.Extension],"") & "\" & [Files.Name]

Obviously, you would need to check that the destination folder exists and create it if not, before attempting to move the file.

Regards,

------------------------------
Carl Carter
Developer Program Manager
Blue Prism
Europe/London
------------------------------