how do i remove y - before a mail

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 :slight_smile: It should be substr($text$, 1) if we want to remove the first character :slight_smile:

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 :slight_smile: )

Here’s how to do it with Regex: Remove certain characters at the beginning of email address.knwf (6.8 KB)

Input:
image

Result:
image

2 Likes

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.

1 Like

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 :slight_smile: . Regex is something I’m getting more used to now.

2 Likes

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. :tophat:

1 Like

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.