How to automate transferring files while creating sub folders?

Hello Everyone.

I have a share folder where I receive daily CSVs files with the name Payments_01012024.csv and I have all csvs until todays date

Is there a way to automate the process to create sub folders in this folder filtered by month year and it moves the csvs directly into those folders on a daily basis?


What’s the date format of your csv file - Payments_01012024.csv? MMddyyyy?

Hi @rfeigel .

The data format is dd-MMM-yy.

Try this. It reads the files in the data folder and writes the most recent one to a mmyyyy named folder, creating a new folder if necessary. The plan would be to run it daily to add the newest file to the correct folder. It will not bulk move your existing files. For that you’d need to read all the files in a loop. Also you’ll need to reconfigure the List Files/Folders, String Manipulation (Create File Path), and String to Path nodes to point to the appropriate folders in your system. You can play with the csv Writer node to see how it works. The samples I’ve created are in the workflow data folder. I have no idea whether a shared folder will create problems.


That actually worked perfectly. Thank you so much rfeigel. I took your advice to try and loop but unfortunately I’m still a beginner at it. It didn’t work so I’ll be sticking to your solution. Thanks for you efforts!

Just a little update, i figured out how to automate the loop and transfer all the files at once. I have attached the workflow of what worked. Once Again, thanks to @rfeigel for the major help and idea for it to work.
Transfer Files to Subfolders Updated.knwf (168.6 KB)

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.