General questions about using TextPad
Moderators: AmigoJack , bbadmin , helios , Bob Hansen , MudGuard
no.cache
Posts: 165 Joined: Thu May 15, 2003 2:52 pm
Post
by no.cache » Sat Apr 18, 2015 10:33 pm
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.
MudGuard
Posts: 1295 Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:
Post
by MudGuard » Sun Apr 19, 2015 3:04 pm
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 » Sun Apr 19, 2015 3:24 pm
Fi nd what: ^(?:(\d)|(\d{2})|(\d{3})|(\d{4})|(\d{5})|(\d{6}))$
Rep lace 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.
no.cache
Posts: 165 Joined: Thu May 15, 2003 2:52 pm
Post
by no.cache » Fri Apr 24, 2015 3:49 pm
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.