changing names of files ouside Knime

Hello i was wondering, while talking about Knime the topic of changing names of files outside the program came up, is there a node that changes the name of a file that is not in Knime? (like a PDF or PNG) ??

Hi @Bleck , I’m not sure I understand “changes the name of a file that is not in Knime”. What does file that is not in Knime mean? Or rather, what does file in Knime mean?

Regardless, I don’t think there is a node for renaming files.

Can you expand a bit on the use case?

One personal case I used Knime for batch renaming files was to generate the OS’ rename commands for the files and save the commands into a batch file.

I did a List Files/Folders, which would result into my “old” file name, and then did some manipulation to generate my “new” names into a new column. Then it was a matter of using a join() function to generate the command.

For example, let’s say I have these files:
image

As you can see, it’s hard to sort them out, because alphabetically, it comes out as 1.csv, 10.csv, 11.csv, 2.csv, etc…

To have them sorted properly, I have to pad a 0 on the left of the single digits.

After padding the leading 0 through String Manipulation, I get this:
image

Then I just generate the rename commands:
image

And I can just write the “rename windows” column to a .bat file, or the “rename linux” (applicable to UNIX and also MacOS) to a .sh file and run them to do the batch rename.

3 Likes

You could try and take a look at this example

With this example you could later delete the original files maybe

4 Likes

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