I ran into a bit of a problem in an automation i want to create and i didn’t manage to find a solution up to this point so i am hopping someone could give me a hand or “push” me in the right direction.
So, I have a large number of files (pdf) in a folder and i only want to move some of those files in another location. I know how to the get the files names and how to move them, the problem is that i don’t know how to make a condition in order to move only some of them based on a list i provide.
first thought that crosses my mind is to create 2 loops - one nested into another. First loop takes file name (Guess that’s the critierium you want to follow) and in nested loop, look for the file and then move it to a desired folder
thanks for the fast replies I made more or less what you guys suggested and if i do it for all files or just one it works without a problem. The thing is that i need to move 1.000 files from a folder that contains 20.000 files, and i don’t know how and where to input those 1.000 file names in the process
I’d recommend using CSV or an Excel (xls, xlsx, xlsm) file. In the process you can simply read range from System/File/Workbook section (it allows programme to work in background) and create DataTable which subsequently will store all names
So I figured out a solution and thought i should share it, just in case anyone else is looking for something like this in the future - also, thank you for your suggestions - they helped me figure it our
Solution: Assign "SourcePath = “your folder location”
Read range the list of files you want to move, with extension (Example: file.pdf) and store them in a table (i called mine “files”)
After that you use a “for each row in data table for files”, you assing “fullPath” to be "SourcePath + row(“FileName”).toString (FileName is the header of the source file) and add a copy file with From=FullPath" and the destination folder you want the files copied to.