Hi I need to remove . and - before the start of an email example .jesusalv@gmail.com or -jesus-alvear@hotmail.com in this case I only need to remove the first one - it is always in the first characte
Hello @Jalvear
If the position of the character is always the first in the string you can use āString Manipulationā node:
substr($text$, 1)
This will remove the first character of a string.
BR
Yes but I need you to remove it if it is . o - since I have emails that are well written, I cannot remove the first character
Ok.
Then you can use the āString Manipulationā to extract the first character in a column:
substr($text$, 0, 1)
Then you can use a Rule Based Row Splitter:
$new column$ LIKE "." OR $new column$ LIKE "-" => TRUE
Afterwards applyā¦
for the port with ā.ā OR ā-ā.
Concatenate all at the end a s a wrap up
BR
Hi @gonhaddock , I think you need some wildcard in your LIKE statements:
$new column$ LIKE ".*" OR $new column$ LIKE "-*" => TRUE
Or you can also check with the substr():
substr($new column$, 0, 1) IN (".", "-")
BTW, your substr() statement will return the first character It should be
substr($text$, 1)
if we want to remove the first character
But all this can be done in 1 node using the Column Expression. But the simplest way can be done via Regex (Iām starting to get the hang of Regex )
Hereās how to do it with Regex: Remove certain characters at the beginning of email address.knwf (6.8 KB)
Input:
Result:
This workflow by following previous instructions:
20220221_.knwf (23.7 KB)
I expect some work from questionerās side. Learning happens by trial and errorā¦
⦠very true and intended
BR
PS.- @bruno29a 's workflow deserves the āsolutionā as it is the cleanest workflow that you can achieve.
Hi @gonhaddock , reading what you just wrote and re-reading what you wrote previously, I now understand what you were trying to do, and now understand what you did was intended. You were indeed extracting the first character as a first step, and expected āsome work from questionerās side. Learning happens by trial and errorā¦ā. I fully support this.
Sorry for jumping in too quickly there, Iām getting excited using Regex recently . Regex is something Iām getting more used to now.
no worries @bruno29a , it is a pleasure to always learn from your posts. In fact I was wondering on the regex statement before you published it.
Thanks to all of you., it was really helpful
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.