Page 1 of 1

adding a 0 at position one when

Posted: Tue Jan 22, 2013 8:14 am
by jan-01
Hello,

Is it possible to add a 0 at postion one when a number has 8 numbers in stead of 9?
Below a sample.
Please advice and thanks in advance

Jan

85315311
85438529
85443956
85480401
219754713
85503010
225379090
225271451
85520020
85520047
225234416
85520055
85534897
85520063
08552008X
85520098
85520101
08553062X
219753342
85539945

Desired output:

085315311
085438529
085443956
085480401
219754713
085503010
225379090
225271451
085520020
085520047
225234416
085520055
085534897
085520063
08552008X
085520098
085520101
08553062X
219753342
085539945

Posted: Tue Jan 22, 2013 9:21 am
by ben_josephs
Assuming the letter X only appears in 9-digit items:

Use "Posix" regular expression syntax:
Configure | Preferences | Editor

[X] Use POSIX regular expression syntax
If the number is the only thing on each line:
Search | Replace... (<F8>):
Find what: ^[0-9]{8}$
Replace with: 0\0

[X] Regular expression

Replace All
Otherwsie:
Find what: ^[0-9]{8}\>
Replace with: 0\0

[X] Regular expression

Replace All