I have a file that I wish to copy and later read.
It appears to be a good idea to use relative path names.
So I have created a mySQL query which returns my file name with the path attached to it.
Hi @Shai
your string should contain backslash “\” instead of “/” and should look like “C:\[Folder]\[File]” for local located Files or “\\[Server]\[Folder]\[File]” for server located files.
The mistake was this: I was hardcoding the ‘knime.workspace’ bit.
knime.workspace is more of a variable and not a literal.
It translates to the literal value at the time of execution.
The variable was sitting right in front of me everytime I was setting up my string manipulation node.
Nevertheless, this is what seems to be the behavior…
Yes @morpheus , I took the blue pill.
I discovered the left slash was the right pill.
So that was all good until…
There is another hurdle that I ended up in this process. I’m not happy with my solution to it.
My workflow copies certain files in certain specific folders within the workspace.
e.g \Myfoldernames\Myfilename
But the workflow expects “\Myfoldernames” to be already available.
If its not already setup, the workflow gives an error.
So I had to create another workflow to ensure that all sub folders are available prior to running my workflow. I’m not happy with having to create a separate workflow.
Is there a file creation, copy, or move node that will automatically create the folder if it is not available?
This was annoying but not a show stopper so I shall come back to this and fix it.
If you know a better solution, it will help.
Makes sense.
In my situation, I need also to ensure that the path is available via a variable.
So had to use a string manipulation node > join function
I wonder if you agree with my second post on this thread where I claim that I found the solution.
Is there a better way?