What do I use to copy/move a file from one folder to another. I’ve looked at but I can’t get it to work.
Maybe this example by @ipazin on the hub might help.
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
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.
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:
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
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
Once you get used to this node business KNIME is a very powerful tool.
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
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.
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.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.