Skip to main content
Solved

Remove space between numbers and letter in a column

  • October 21, 2022
  • 2 replies
  • 34 views

arash_hokm
Contributor
Forum|alt.badge.img+8

I have a mix column that contains numbers and letters. in some records the first value or two first values ​​are number and then is a space then comes letter. the space und letter don't appear in all records. if a record contains this space I want to remove the space between number and letter.

For example : 2 a -> 2a oder 22 a -> 22a.

 

 

 

Best answer by ebygomm

This regex will match any space preceded by a number and followed by a letter. 

(?<=\d)\s(?=[a-zA-Z])

If you use it in a StringReplacer with ReplacementText of nothing you should get the result you are after

 

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

ebygomm
Influencer
Forum|alt.badge.img+44
  • Influencer
  • 3422 replies
  • Best Answer
  • October 21, 2022

This regex will match any space preceded by a number and followed by a letter. 

(?<=\d)\s(?=[a-zA-Z])

If you use it in a StringReplacer with ReplacementText of nothing you should get the result you are after

 


arash_hokm
Contributor
Forum|alt.badge.img+8
  • Author
  • Contributor
  • 44 replies
  • October 21, 2022

This regex will match any space preceded by a number and followed by a letter. 

(?<=\d)\s(?=[a-zA-Z])

If you use it in a StringReplacer with ReplacementText of nothing you should get the result you are after

 

Thanks alot 🙂