Regex help for path

Hi, I am trying to create a regex to give me the files in this link. the link names are slightly modified/dummies.
“C:\Users\GARCIAS\OneDrive - Nnnnn\Documents\Porque G\Research\YUTO\OMSD Data conversion\Knime\YUTO_2023_Q1.xlsx”

Does it have to be a regex?
In the string manipulation node I often use somesthing like:

substr($yourCol$, indexOf($yourCol$,"\\","b")+1)

indexOf… finds the first "" backslash beginning at the end
substr … gives you the substring beginning of the starting index given by indexOf

3 Likes

Hello @sergiogarciagt,

to add on @ActionAndi solution there is getFileName() function in Column Expressions node (in newer versions called Expression node). For this to work your column must be type Path. Also I was pretty sure there is a node which extracts this kind of information (file name, file extension…) from paths but now can’t find it.

Br,
Ivan

2 Likes

@ipazin : That’s cool! I didnt know the Column Expression function. Great.

There is this “Files/Folders Meta Info” node. It’s usefull but horrible slow in case of many files.

3 Likes

@ActionAndi glad to hear that.
Files/Folders Meta Info node does provide some meta info but not the one I thought it does. Maybe it used to…
Ivan