Download files from different folders and rename them

Hi everybody,
Hope all is good
I need to do something but I don’t know how can I do it
I have an excel file let’s say named x that is generated automatically by a robot and put in a folder named with date of creation… all those folder exists in a folder on shared drive
what I need to do is to get all those excel files and name them with the name (date of creation) of their folders
I’m now learning python and I know there’s a way to download those files but how can I access each folder and rename the file excel in it with the folder name
is there any way to do this… with any extension or programming language

any idea will be much appreciated
thanks in advance

Hello @Mai_Nashaat,

if I got it right you would like to append date of creation to file names? And this creation date is (or part of) folder name? This can be done with Python but if you already work with KNIME you can use it as well. (Especially doesn’t make sense to me to use Python within KNIME for renaming files.) Anyways you Transfer Files node is the nodes which among other functions renames files as well.

Give it a try and if you’ll have questions/issues feel free to ask.

Br,
Ivan

2 Likes

Actually it’s a folder has folder whose name is date of creation and each folder has it’s excel file
So I have folder-> folders->excel file

Hello @Mai_Nashaat,

so you have something like this?

folder → folder_date1 → Excel file1
folder → folder_date2 → Excel file2
folder → folder_date2 → Excel file3

And would like Excel files to have dates after file name?

Br,
Ivan

Hello i have a similar request and try to use the new “Transfer File” node to rename a file in a SFTP folder, having the source and target under the same folder. However, i ran into an issue with the “transfer file” node with no way to specify the new name. The destination only allows specifying the folder name and not the file name. The file name will remain unchanged from the source. Please advise what can be done?

Thanks
Ken

Hello @kkam,

see here for more info:

Edit: Addressed with KNIME version 4.4.0. Check linked topic above.

Br,
Ivan

2 Likes

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