I am trying to configure the Extract System Properties node to give me a flow variable for the path.separator. I cannot figure out how to do this. I am just trying to pass that one variable (path.separator) and nothing else. I have tried under the flow variable tab in the node to set the selectedProps to the variable name path.separator, but I don’t think the variable name has to actually be that. Anyway, I’m not getting the path separator which I expect to be “/”.
@mbishopp this component will give you the path separator depending on your operating system.
Hi @mbishopp , I think you are wanting “file.separator” from System Properties. the path separator is the character that separates individual whole-paths (such as used in the Windows system PATH environment variable).
e.g. c:\program files\something ; c:\program files\something else
file separator isn’t exactly obvious though… I’ll admit! I expected it to be folder separator
btw, depending on what you are needing to do, within KNIME, the forward slash works in ALL operating systems including windows
e.g. I can create a string variable myfile set to
“c:\temp\myfile.txt” or
“c:/temp/myfile.txt” or even
“c:\temp/myfile.txt”
and they will all work when converted to a path variable, so generally you can just choose to use “/” unless you are trying to parse the file/folder names yourself.
As an aside, if you are trying to break up an existing string or path into various “parts”, the following components may also be of use: