Remove a text partially
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello,
I need your help with removing a text partially from rows: for example, I need to remove any text before "LF" in a row.
For example, I have these 3 texts:
abcdfgrLFxyzw
fgtrVHbnLF56thfi
bGNTzucd456
For the first row: I need to remove abcdfgr and keep only LFxyzw
For the 2nd row: I need to remove fgtrVHbn and keep only LF56thfi
I used RegEx to remove any text before LF BUT now I noticed that the rows that have no LF are marked as Null:
When I use the RegEx, the 3rd row appears as Null instead of showing up exactly as is: bGNTzucd456
How do I remove the text before LF only in the rows that have LF in them and not affect the other rows (that don't have this text LF in them)?
Your help is greatly appreciated!
Kind regards,
Ioana
Solved! Go to Solution.
- Labels:
- Regex
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
You can use an If statement to check if LF exist and apply regex only on them.
IF Contains([Input], "LF")
THEN REGEX_Replace([Input], ".*(LF.*)", "$1")
ELSE [Input] ENDIF
Workflow:
Hope this helps : )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@atcodedog05 thank you so much for your help! It worked! I didn't know that we could combine both the IF statement and RegEx. I learn new things every day it seems!
Have a wonderful day!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@OllieClarke hello! thank you for your help! it worked!!! and it was so easy. It seems I wasn't using the RegEx at its full capacity. I wasn't seeing the forest from the trees.
this solution is quite fast and efficient. I appreciate your time!
Regards,
Ioana
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I can agree on that @ivoiculescu2020 lot of different possibilities to explore 🙂
Happy to help : )
