Include up counting Indexnumber in Filename or Date

Hi there,

I am using the transfer file node to copy a file from a specified path to an backup directory in this backup directory are the old backup files and it looks like:

XXX_1
XXX_2
XXX_3

XXX= the filename and is always the same. The newest backup gets the Highest number so XXX_3 would be the latest Backup.

If the transfer file node is now copying a file to the backup destination it should somehow “know” that the highest number in the folder is “3” and give the moved file the name:
XXX_4

How would i do this?

Some additional hints:
The indexnumber of the file would always be the last place in the filename.
Alternatively one could count the numbers of files the indexnumber 3 means there are 3 files in the destination folder.
Or second alternative one could put at the end of the filename the date in the format like year/month/day.

Thanks for reading!

Hi @TotalDataLoss

I would use the List Files/Folders node to identify the names of the files in the folder. With that information create the next logical number / extension. See this example.
KNIME_project4.knwf (29.0 KB)


Hope this helps.

Gr. Hans

2 Likes

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