Move Line Breaks After Page Number

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
djdestroyer
Posts: 3
Joined: Thu Feb 21, 2008 8:19 pm

Move Line Breaks After Page Number

Post by djdestroyer »

I am trying to search for line breaks in a group of documents using wildedit. Below is a sample:

Code: Select all

-


-                                              PAGE-  1 OF   2

Now the page numbers could possibly go up into the twentys, so I came up with the following, but it doesn't work:

Code: Select all

\r\n\r\n\r\n-                                              PAGE-   [1-2][0-9] OF   [1-2][0-9]
All of the code was working until I put in the [1-2][0-9]
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

That expression will only work with pages 10-29.

If no lines will include PAGE-, then you could probably use

Code: Select all

^-.*PAGE-.*\n
[/b] instead of

Code: Select all

-            PAGE-   [1-2][0-9] OF   [1-2][0-9]
[/b] for the last line.
Hope this was helpful.............good luck,
Bob
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Or

Code: Select all

\r\n\r\n\r\n- +PAGE- +[1-2]?[0-9] OF +[1-2]?[0-9]
djdestroyer
Posts: 3
Joined: Thu Feb 21, 2008 8:19 pm

Post by djdestroyer »

Okay, I tried this:

Code: Select all

Find What:
\r\n\r\n\r\n- +PAGE- +[1-2]?[0-9] OF +[1-2]?[0-9]

Code: Select all

Replace With:
\r\n- +PAGE- +[1-2]?[0-9] OF +[1-2]?[0-9]\r\n\r\n

Code: Select all

What was in the original file:



-                                              PAGE-  1 OF   1

Code: Select all

What I got when I ran the replace:
- +PAGE- +[1-2][0-9] OF +[1-2][0-9]

Code: Select all

What I hoped for:

-                                              PAGE-  1 OF   1
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Find what: \r\n\r\n(\r\n- +PAGE- +[1-2]?[0-9] OF +[1-2]?[0-9])
Replace with: $1\r\n\r\n

[X] Regular expression
[X] Replacement format
djdestroyer
Posts: 3
Joined: Thu Feb 21, 2008 8:19 pm

Post by djdestroyer »

Thanks Ben, it worked.
Post Reply