Hi,
I have a couple of text files that contain transcripts from conversations, text and numbers. In some files, the numbers have a blank space between them.
For example:
We will come in on Saturday to upgrade 2 8 servers. Those are the last machines on the list, so we'll have completed all 1 3 4 servers.
In that example, I'd need to find the 2 8 and the 1 3 4 and remove the space so the outcome is
We will come in on Saturday to upgrade 28 servers. Those are the last machines on the list, so we'll have completed all 134 servers.
I can find the text by searching for [0-9] [0-9] but I've not figured out what I would replace it with to remove the spaces. Plus I'm sure there's more intelligent ways to find the separator spaces between numbers.
Any help would be appreciated.
Remove blank spaces between numbers
- DigitalVolcano
- Site Admin
- Posts: 1863
- Joined: Thu Jun 09, 2011 10:04 am
Re: Remove blank spaces between numbers
This example using lookahead works well in the tester:
regex:
replace:
Disclaimer: I got it from here:
http://stackoverflow.com/questions/6929 ... tween-them
regex:
Code: Select all
\b(\d+)\s+(?=\d+\b)
Code: Select all
$1
http://stackoverflow.com/questions/6929 ... tween-them