Hi if I have a random name string with isolated characters like
"adam123 a factory", how can i recomve the solitary a in the middle, without moving the one at that start of adam or indeed in factory?
best and thanks Darren
Removing single characters
-
- Administrator
- Posts: 78608
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Removing single characters
In the Replace dialog (Ctrl+H), enter " a " (without the quotes) in the 'Find what' box, and "a " " " (again, without the quotes) in the 'Replace with' box. Then click Replace or Replace All.
Best wishes,
Hans
Hans
-
- BronzeLounger
- Posts: 1412
- Joined: 08 Jul 2016, 18:53
Re: Removing single characters
Wouldn't find space a replaced by space work better?
-
- Administrator
- Posts: 78608
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Removing single characters
That would also remove the a at the beginning of a word:
"It was an accident"
would become
"It was n ccident"
"It was an accident"
would become
"It was n ccident"
Best wishes,
Hans
Hans
-
- Administrator
- Posts: 78608
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Removing single characters
Also, it would leave 2 spaces in the middle when removing the a in iksotof's example.
Best wishes,
Hans
Hans
-
- Administrator
- Posts: 12628
- Joined: 16 Jan 2010, 15:49
- Location: London, Europe
Re: Removing single characters
I suspect you meant
In the Replace dialog (Ctrl+H), enter " a " (without the quotes) in the 'Find what' box, and " " (again, without the quotes) in the 'Replace with' box.
Otherwise the a won't be removed, just the space before it!
StuartR
-
- 4StarLounger
- Posts: 564
- Joined: 27 Jun 2021, 10:46
Re: Removing single characters
For a slightly more generic solution I think I'd favour switching on Wild Card matching ("Use Wildcards"), and then searching for
"<?> " (without the quotes)
And leaving Replace empty
"<?> " (without the quotes)
And leaving Replace empty
-
- 5StarLounger
- Posts: 604
- Joined: 18 Jan 2022, 15:59
- Location: Re-routing rivers, in Hof, Beautiful Bavaria
Re: Removing single characters
I thought that as well, but I was afraid I had missed something again. I do that sort of find replace often to get rid of words but not when they appear as part of another word.
I seriously don’t ever try to annoy. Maybe I am just the kid that missed being told about the King’s new magic suit, :(
-
- Administrator
- Posts: 78608
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
-
- 5StarLounger
- Posts: 818
- Joined: 24 Jan 2010, 15:56
Re: Removing single characters
Excel doesn't have wildcard matching though (other than in the VBE), unlike Word.
Regards,
Rory
Rory
-
- 4StarLounger
- Posts: 564
- Joined: 27 Jun 2021, 10:46
Re: Removing single characters
Fair point! Missed the fact that I'd dropped into an excel specific topic.
I'd still use ? instead of a for a more generic solution
I'd still use ? instead of a for a more generic solution
-
- 5StarLounger
- Posts: 818
- Joined: 24 Jan 2010, 15:56
Re: Removing single characters
Depends on the need, though. If you want to remove " a " but not " I " for example, specific is better than generic. ;)
Regards,
Rory
Rory
-
- 4StarLounger
- Posts: 564
- Joined: 27 Jun 2021, 10:46
Re: Removing single characters
Which is why I labelled it as a generic solution,
-
- 3StarLounger
- Posts: 315
- Joined: 04 May 2010, 15:18
Re: Removing single characters
Thank you for the solutions. Sorry for the late acknowledgment, I don't get the opp to drop by much.