hi
I got multiple files (PDF) in a folder and need to create for each file a new folder according to specific and unique name / number each file have.
will like help and solution
thanks
hi
I got multiple files (PDF) in a folder and need to create for each file a new folder according to specific and unique name / number each file have.
will like help and solution
thanks
Hey @nir.kail
You can utilise For each file activity,
Then create folder as required inside loop for each file.
Move the file to that specific folder using Move activity.
Hope this helps.
Thanks
#nK
Welcome to our UiPath community.
Please follow below steps.
First use below expression to read all pdf files from the source folder as below.
arrPdfFiles [] = Directory.GetFiles("FolderPath","*.pdf")
And then use For Each loop activity to iterate one by one file from above output array.
For Each item in arrPdfFiles
Use Create Folder activity and pass name as below.
"FolderPath"+"\"+Path.GetFileNameWithoutExtension(item)
And then use Move File activity and pass below parameters to it.
From Path: item
To Path: "FolderPath"+"\"+Path.GetFileNameWithoutExtension(item)
Welcome to the UiPath community Nir, these are both great replies and possible solutions for your project. I also support using a For Each Loop within the file directory. You can also add a counter variable that can be used as a unique identifier on the folders that are subsequently created. If you wanted the folder name to include the counter and something else, you could use an assign node to perform a simple concatenation and customize the folder name how you see fit.
Hi
Thanks for the answer
Which activity I need to use for the:
Also I can I add –
For Each loop activity
I can’t see it in the activity list
thanks
Search for For Each activity
Hi
Thanks for your help
Also if you know Which activity I need to use for the:
??
@nir.kail Please find attached workflow below
Example.zip (59.7 KB)
This workflow creates folders with the file name and moves the file to that folder
Note : if you don't want the file to be moved to that folder disable Move File activity in the code