I am working on making a script that moves files from one folder to another if the file name contains certain strings such as .jpg or .png.
This would be helpful in the future to clean up directories of project teams where families are in the wrong folders, etc.
I am able to call to my desktop for example and get a file list… then I want to filter the list but I am not sure of the best filtering approach - by string? by mask? with a custom node?
I am also not sure how the file.move node works and searching through the dynamo forum didn’t return any results related to this. I am concerned it is just going to pick up all files and move them which is not what I am looking to do…
Is it possible to do this with Dynamo or is it better to make a batch file?
I have been reading this post to try and wrap my head around list functions:
Most of the ‘nodes’ relate to data transformations, but also includes various file nodes https://help.pentaho.com/Documentation/5.1/0L0/0Y0/0L0/040
It is a fantastic tool if you work with databases and the community edition is free.
Hi Emily,
You should be able to do what you are after by appending the name of the file that you want to appear in the destination folder. You are currently giving the newpath a destination directory, but no file name. It’s confusing, becuase the operation is really a “move and name” operation.
Hey Zach, can you show a quick example of this doing multiple files at once? I tried list.combine and it doesn’t seem to work. I also tried feeding the lists directly into file.copy and it tells me it doesn’t take arguements of _array,_array, so I assume it doesn’t accept lists.
I’m trying the File.copy. Here is some sample screenshot.