Remove single character between spaces in a string
- 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
Hi,
I have a dataset which has strings in the format below
ABCDE F GHIDJ
AB C DEFGHIJ
ABCD E FGH I
I would like to find a way to only remove the character that is by itself.
ABCDE F GHIDJ --> ABCDE GHIDJ
AB C DEFGHIJ --> AB DEFGHIJ
ABCD E FGH I--> ABCD FGH
I tried used the RegEx tool however am not really sure how to use it.
Thanks for the help in advance!
Solved! Go to Solution.
- Labels:
- Common Use Cases
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Use it like this:
Regular Expression is <space><dot><space>
Replacement Text is <space>
the result is:
- 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
What is the difference between the first option (Space, dot, space) and second option which is : (.*)\s[[:alpha:]]\s(.*)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I don't think there's any difference, both examples will achieve the same result
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hate to resurrect an old thread, but I have multiple single letters that I need removed. I've tired both options listed here, and they only remove the first single letter found.
For example, I want to remove the two single letters below. And the single letters vary.
WORD J ANOTHERWORD H
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
@Number4 it's always best to start a new thread for your new problem. It helps with getting the right answer to your problem 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
I tried both approaches. It is not giving the desired result if the input is like this :
Input :
A BCDE F GHIDJ K
AB C DEFGHIJ
ABCD E K FGH I
Desired Output :
A BCDE GHIDJ
AB DEFGHIJ
ABCD FGH
Appreciate any other workarounds.

