I need to place an excel file in Knime Workflow directory, and consume it using Python node. How do I do that so that It is transported along with Workflow artifacts and other folders to different environments and the path remains dynamic.
Please help!!
-
Put the file in the workflow directory (if at all, this is mega-fiddly in KNIME GUI, so I just do it in the OS by going to the “workspace” folder)
-
In KNIME, use the URL
knime://knime.workflow/path/workflow.txt
to access it (i.e. literalknime://knime.workflow
+ subpath) -
If you need to access it in a script, it probably makes sense to build an absolute file URL to the file upon execution – a while ago, I did this using the following absurdly looking node sequence, which would give me something like
file:/Users/me/knime-workspace/workflow/path/workflow.txt
or/Users/me/knime-workspace/workflow/path/workflow.txt
:
Just ensure that these nodes re-run upon each execution, so that the path is always updated to the current system environment (hence the red input to the Table Creator)
HTH,
Philipp
@sujitnath84 about the transfer of data between KNIME and Python you might want to take a look at these examples to see paths variables in action like @qqilihq suggested.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.