I try to remove () to clean up my data. for example: (416)6666666, I want to remove ( ) and make it look like 416666666. I use map function and remove string (). But it never works for me.
Hi Dai Zhang.
This should do it:
String to Search: \(|\)
The bar separating the two search values means OR. So it removes all matches for \( OR \)
Thanks for replying. Which step is to remove ()?
My pic is from a function within the Map component.
Add a data process shape and use "Search/replace" will work. Don't forget to escape the "(" and ")". See screenshot below.
Thanks for replying. I imported a file containing multiple columns. But I only want to remove '()' for a specific column. Not sure if data process can do it.
You can use the same Regex that Sjaak mentioned in a Replace Map Function. The reason it wasn't working before was because the Replace function is expecting Regex input and () has special meaning in Regex so those need to be escaped.
Thanks for replying. I guess I have to write groovy code to remove () for a specifying column.
Not sure why you need Groovy code? Can you not just use the pre-built Map Function and only pass in the source column you want to remove it from?
It does not work for me to on removing parentheses. Below is what I have.
You didn't include a screenshot in your last post.
Please see the attached pic. I add escape in front of (). But it removes all character. For example, (416)6666666, It will turn it into blank... but I still want all the numbers....
You will need to search for \(\)
I put exactly what you suggested. But it does not remove bracket. (416)666666.
Awesome, it works! Thanks
I like the |. That simplifies my example on this post too.
Retrieving data ...