This is a modified version of the original Edit Path Variable Filename which, because of a KNIME bug could not operate inside a conditional branch within KNIME. This version differs only in that the returned path variable name is always given the prefix "path_" and therefore cannot replace an existing path variable.
Allows on-the-fly "editing" of an input path and file name using string concatenation (additon of simple prefix or suffix to a filename) or replacement of filename using regex, and direct replacement of filename extension.
Also allows the folder path to be modified using regex replacement.
Where regex is used, it follows the regex required by the String Manipulation regexReplace function, so any use of a \ within a folder path must be entered as double-backslash \\ so that regex does not misinterpret the character.
Example replacement that could be performed:
For an incoming file path representing
c:\myoutputfolders\excel\somefile.xlsx
Setting:
prefix: accounts-
suffix: -formatted
regex file search: (.*)file
regex file replace $1sheet
regex folder search: (.*)\\myoutputfolders\\(.*)
regex folder replace: $1\\formattedoutputs\\$2
would result in the output file:
c:\formattedoutputs\excel\accounts-somesheet-formatted.xlsx
@takbb Brian Bates 28 October 2023
To use this component in KNIME, download it from the below URL and open it in KNIME:
Download ComponentDeploy, schedule, execute, and monitor your KNIME workflows locally, in the cloud or on-premises – with our brand new NodePit Runner.
Try NodePit Runner!Do you have feedback, questions, comments about NodePit, want to support this platform, or want your own nodes or workflows listed here as well? Do you think, the search results could be improved or something is missing? Then please get in touch! Alternatively, you can send us an email to mail@nodepit.com.
Please note that this is only about NodePit. We do not provide general support for KNIME — please use the KNIME forums instead.