three-digits format in replaced form

General questions about using TextPad

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

Post Reply
yavien
Posts: 2
Joined: Tue Apr 29, 2008 3:35 pm

three-digits format in replaced form

Post by yavien »

Hi all,

I try to replacing/adding nummeration in my text.

for expample:

Code: Select all

Find what: {text} 
Replace with: \i&

[X] Regular expression
Will give me:
1{text}
2{text}
...
10{text}
11{text}
...
134{text} etc.

BUT, I want to have nummering with three-digits numbers, like:
001{text}
002{text}
...
010{text}
011{text}
...
134{text} etc.

Is any tip for it?

Thanks for advance :-)
HerNameWasTextPad
Posts: 59
Joined: Fri Apr 18, 2008 3:25 am

Post by HerNameWasTextPad »

I'm sure WildEdit could do it (he says with a wink).

Try this:

- Search for all {text} literals and Mark All
- Edit -> Copy Other -> Bookmarked lines
- Paste into a new document
- Take the word wrap off the new document, if it's not already off, using Ctrl+Q, W
- Configure -> Block Select Mode
- Select all of column 1
- Edit -> Fill Block...
- In the Fill Selected Block dialog box, select "With numbers from:"
- Read the rest of the dialog box and make further appropriate selections, such as "Format: Leading zeros"

Does this give you what you need?
Last edited by HerNameWasTextPad on Tue Apr 29, 2008 8:31 pm, edited 1 time in total.
I came in on 4.5 in 2001, moved to 4.7.2 in 2004, moved to 4.7.3 in 2007, moved to 5.4 in 2010, and am excited about 2013. I've said it many times before, and I'll say it many times again: "I love this program."
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Or
Find what: {text}
Replace with: \i(1001)&

[X] Regular expression

Replace All
Then
Find what: ^1
Replace with: [nothing]

[X] Regular expression

Replace All
yavien
Posts: 2
Joined: Tue Apr 29, 2008 3:35 pm

Post by yavien »

The second tip is more usefull for me (and it is very clever!). In my file are another lines with another text.
HerNameWasTextPad, ben_josephs many thanks for responses :D
HerNameWasTextPad
Posts: 59
Joined: Fri Apr 18, 2008 3:25 am

Post by HerNameWasTextPad »

We TextPad users are here to help and to share what we've discovered, because we know that the more others enjoy the program, the more support TextPad will receive, and of course the happier we will be to know that our favorite program will remain strong and well-supported.

Ironically, through my involvement with this particular post, I learned something important regarding \i(1001)& (courtesy of ben_josephs) that I did not know--something that could benefit well my own work.

I thank you, too.
I came in on 4.5 in 2001, moved to 4.7.2 in 2004, moved to 4.7.3 in 2007, moved to 5.4 in 2010, and am excited about 2013. I've said it many times before, and I'll say it many times again: "I love this program."
Post Reply