Achieving "Zero Fill" with Textpad

General questions about using TextPad

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

Post Reply
User avatar
no.cache
Posts: 165
Joined: Thu May 15, 2003 2:52 pm

Achieving "Zero Fill" with Textpad

Post by no.cache »

Hey everyone, I need to simulate "Zero Fill" numbering on a huge text document that has over a million lines (1,000,000), so that
^99
zero fills to
^0000099

Thanks everyone!
Trump.
Jesus wept.
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

I don't see a possibilty to do this in one go.

But you could do it in 6 steps.

Step 1: Replace ^\d{1}$ by 000000$&
Step 2: Replace ^\d{2}$ by 00000$&
...
Step 6: Replcae ^\d{6}$ by 0$&
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Find what: ^(?:(\d)|(\d{2})|(\d{3})|(\d{4})|(\d{5})|(\d{6}))$
Replace with: ?1(000000$1):?2(00000$2):?3(0000$3):?4(000$4):?5(00$5):?6(0$6)
Edit: But that will only work in TextPad 7.
User avatar
no.cache
Posts: 165
Joined: Thu May 15, 2003 2:52 pm

Post by no.cache »

Mud, Ben . . . thanks. Doing the ZF manually can be done in minutes so that's what I'll continue to do. Just wanted to see if it was possible.
Trump.
Jesus wept.
Post Reply