Page 1 of 1

Insert Leading Zeroes

Posted: Wed Jun 01, 2011 12:11 am
by ScottJames
Apologies if the answer to this lurks here somewhere, but a search did not turn it up.

I have a list of numbers like so:

Image

I'd like to insert a leading zero before every single digit number, so that the list appears so:

24 25 23 27
00 04 14 22
24 24 21 21
24 25 20 13
10 12 08 11
12 11 09 11

etc.

I've been banging on this with no luck for a while, so any help is greatly appreciated.

Posted: Wed Jun 01, 2011 5:56 am
by ak47wong
Enable POSIX regular expression syntax in Configure > Preferences > Editor.

Then perform this Replace operation:

Find what: _([0-9])(_|$) [replace the underscores with spaces]
Replace with: 0\1\2
[X] Regular expression
Click Replace All

Posted: Wed Jun 01, 2011 8:00 am
by ben_josephs
Or
Find what: _([0-9])\> [Replace the underscore with a space]
Replace with: 0\1

[X] Regular expression

Replace All

Thanks

Posted: Thu Jun 02, 2011 11:11 pm
by ScottJames
Excellent. Thank you very much for the speedy and dead-on help.