adding a 0 at position one when

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
jan-01
Posts: 19
Joined: Fri Apr 27, 2007 9:40 am

adding a 0 at position one when

Post 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
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post 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
Post Reply