Line numbers with leading zero's

General questions about using TextPad

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

Post Reply
confused
Posts: 2
Joined: Tue Feb 02, 2010 4:16 pm

Line numbers with leading zero's

Post by confused »

I would like to be able to replace the first 6 characters of a line with sequential line numbers that have leading zeros.
The first six characters in the lines are a combination of Uppercase Alphabetic, Numbers and other characters such as * > ?
I intend to use ^...... (Carat followed by six period characters) to identify the first six characters in the line. What Replace expression do I need to generate line numbers in the form of:
000010
000020
000030
.. etc
confused
Posts: 2
Joined: Tue Feb 02, 2010 4:16 pm

Use Block Mode

Post by confused »

I found a solution that worked for me. - Thanks go to Bob Hansen for his reply in another post.

Configure/Word Wrap Off and Block Select Mode
Select the columns you want to fill, replacing the existing numbers.
Choose Edit/ Fill Block/
Select Fill With Numbers vs. characters
Enter number range from 100, increment by 10
Select format for Leading zeros
Choose Fill Mode of Replace,
mgaert2
Posts: 7
Joined: Mon Feb 15, 2010 2:35 pm

Simpler

Post by mgaert2 »

There is a simpler way:

Search / replace "^......" with "\i(9000010,10)", then
Search / replace "^9" with "".
Post Reply