Remove a string from a directory path

Hi everyone, I am trying to short a directory path or remove some string from it.

For instance take: “C:\1999\Folder 1\Folder 2\Folder 3\Folder 4\ExcelFile.xlsx” and obtain:

"C:\1999\Folder 1\Folder 2\Folder 3"

I was using the String Manipulator and its variable versión but I guess that the "" backslashes are causing trouble.

Thank you

String Manipulation Var Name.knwf (18.4 KB)

Hi @salazachou,
indeed the backslashes cause trouble here. But you can easily tell the String Manipulation (Variable) node to read it as a backslash by adding a second one:
replace(string($${Spath}$$),"Folder 4\\ExcelFile.xlsx","")
In the String Manipulation node, I think you should also remove the * symbols.
Best regards,


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.