Skip to main content
Solved

Hello, Can please someone let me know how to remove all extra characters form values in column. More specifically how I can get Table two from Table 1. FYI, I am using FME2022.

  • Sep 19, 2023 12:12 AM UTC
  • 3 replies
  • 93 views

Forum|alt.badge.img

Table 1Table 1 

Table 2

Table 2

Best answer by ebygomm

Hi @ebygomm thanks for your answer. I used a string searcher with the above regex on my real dataset, but it filtered the data into two ports, those rows contain the regex and rows not contain the regex. However, I used a AttributeSplitter and split the values based on ( character (First part of a parentheses).

After the string searcher you just need to send both matched and unmatched ports to the same place

imageYou could also instead use a StringReplacer and replace everything that occurs from the bracket and beyond with nothing

image

View original
This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

3 replies

ebygomm
Evangelist
Forum|alt.badge.img+54
  • Evangelist
  • Sep 19, 2023 7:50 AM UTC

You could use a string searcher with the following regex

.+(?=\s\()

Which will match everything that occurs before a space and opening bracket


Forum|alt.badge.img
  • Author
  • Sep 20, 2023 12:00 AM UTC

You could use a string searcher with the following regex

.+(?=\s\()

Which will match everything that occurs before a space and opening bracket

Hi @ebygomm thanks for your answer. I used a string searcher with the above regex on my real dataset, but it filtered the data into two ports, those rows contain the regex and rows not contain the regex. However, I used a AttributeSplitter and split the values based on ( character (First part of a parentheses).


ebygomm
Evangelist
Forum|alt.badge.img+54
  • Evangelist
  • Best Answer
  • Sep 20, 2023 8:25 AM UTC

Hi @ebygomm thanks for your answer. I used a string searcher with the above regex on my real dataset, but it filtered the data into two ports, those rows contain the regex and rows not contain the regex. However, I used a AttributeSplitter and split the values based on ( character (First part of a parentheses).

After the string searcher you just need to send both matched and unmatched ports to the same place

imageYou could also instead use a StringReplacer and replace everything that occurs from the bracket and beyond with nothing

image