Local file copy/move

What do I use to copy/move a file from one folder to another. I’ve looked at image but I can’t get it to work.

Maybe this example by @ipazin on the hub might help.

2 Likes

Hi there @DrCannata,

welcome to KNIME Community!

Seems you can’t configure node. Probably you don’t have URI column type so you should use String to URI. Give it a try and if any questions feel free to ask :wink:

Br,
Ivan

3 Likes

That’s actually what I have I think:
image

The Copy/Move Files Configuration shows this,

Hi there @DrCannata,

ok, so you have the URI column but you can’t use same URI column for both Source and Target. So instead of choosing option Use path from target column use second option Use source name and output directory where you choose directory and file names will be the same. To use first option you need another URI type column which will have target location.

Br,
Ivan

1 Like

Thank you, but I still don’t know how to get something to show up in Source other than URI. I would expect I could somehow specify a file name. But this doesn’t seem to work:
image

I created an example showing how to create local URI strings to give individual outputs. Other than that the Copy/Move node allows you to just give a folder (unfortunately KNIME protocol syntax does not seem to work).

To construct an individual filename could be useful if you want to add a prefix or a timestamp or something.

I admit that is not entirely straightforward. You could still just use the local folder from the /target2/ example

3 Likes

Oh my, I think I’ll look for another solution.
Thanks for your time.

This only demonstrates the full range of file name possibilities if you want a dynamic setting. In your case, it would be enough to extract the URI and file names and give the target folder. Everything else would be done by the node. No reason to give up :slight_smile:

Once you get used to this node business KNIME is a very powerful tool.

1 Like

Hi @DrCannata,

if our suggestions till now don’t work can you tell me more about your use case? If I got it right you are transferring files from Downloads folder to another location? Are you moving multiple or single file? Would you like to rename file(s)? Are you doing this on a daily basis?

As said maybe you don’t need to give up just yet :wink:

Br,
Ivan

1 Like

In this case, I want to move one file, which will always have the same name to a directory, which will usually have a different name each time I run. I’m doing this on a daily basis.

Then you might want to construct an URI file name as has been demonstrated in the basic example. You would switch out the target folder and leave the file name intact:

If you need more advanced methods I have played about with URLs and URI. Then you could use more complex paths or change file names.

1 Like

Hi @DrCannata,

here is workflow example you can check and hopefully use:

It will always move one file to location you chose. In order for workflow to run successfully I first write some data to workflow directory and then list exactly data file in List Files node.

Hope it helps and if any questions feel free to ask.

Br,
Ivan

1 Like