Skip to main content
Solved

Help with configuring attribute splitter to skip specific delimiters


I'm having trouble using AttributeSplitter to split everything with a semicolon as delimiter, EXPCEPT skip seimcolon's that are within parentheses. Please help! Thanks!

 

Example 1424462 (EXT: 1488296; 1491537); 1428106; 1436651; 1436653

 

What I need is:

1424462 (EXT: 1488296; 1491537)

1428106

1436651

1436653

 

Best answer by dustin

Here is a possible solution, although it assumes the parenthesis will be in the first list element. I've attached my test workbench that you could copy the transformers from.image

View original
Did this help you find an answer to your question?

4 replies

dustin
Influencer
Forum|alt.badge.img+31
  • Influencer
  • Best Answer
  • July 22, 2022

Here is a possible solution, although it assumes the parenthesis will be in the first list element. I've attached my test workbench that you could copy the transformers from.image


ebygomm
Influencer
Forum|alt.badge.img+38
  • Influencer
  • July 22, 2022

I would usually do something like regex to replace the delimiters outside the brackets with a different delimiter with a StringReplacer and then use that in the attribute splitter

 

I think this should match semi colons outside of brackets

;(?=(((?!\)).)*\()|[^\(\)]*$)

 


dustin wrote:

Here is a possible solution, although it assumes the parenthesis will be in the first list element. I've attached my test workbench that you could copy the transformers from.image

This worked! Thank you very much!


Forum|alt.badge.img+2

@bgossett127​ or a single StringReplacer with the regex ( \\(EXT:([ 0-9]+;?)+\\)) replaced with <blank> to remove the extensions and then followed by the AttributeSplitter to split the remaining string


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings