Removing string with different delimiters and length

Hi there,

I need help with how to extract a string from another string with very specific situations. I have tried using Cell Splitter, Regex Split, String Manipulation but can’t get the results I need.

Here is the table which has different label naming conventions because people aren’t consistent:

image

Sample.xlsx (9.7 KB)

If anyone can please help, I would greatly appreciate it.

1 Like

Hi @ViTLe

If I use the Cell Splitter node with only a dash as a delimiter, it gives the expected output. Did you try the dash as delimiter, so without white spaces; and leave the option Remove leading and trailing white space chars (trim) checked?
gr. Hans

5 Likes

You can try String manipulation node with function
regexReplace($nameOfColumn$,"^[^\\w+([^\\w]+|[_]+)","").
It will remove all alphanumeric characters from the beggining of string to first non alphanumeric characters and leave desired part of string.

2 Likes

Hi @ViTLe
A possible solution with two nodes:
image

  • ‘String Manipulation’ node:
    replace($column1$, " ", "")

  • ‘Cell Splitter’ node:
    Delimiter “-” (just this)

RESULTS:
image

BR

2 Likes

@gonhaddock @piotr_domagala @HansS Thank you so much, all your solutions worked and it’s so fantastic that a solution can have so many different ways.

4 Likes

@HansS You are a legend HanS. I think I overcomplicated my use of the Cell Splitter when it was a simple - setting, which is why I couldn’t get it to work.

4 Likes

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