Page 1 of 1

Move Line Breaks After Page Number

Posted: Thu Feb 21, 2008 8:24 pm
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]

Posted: Thu Feb 21, 2008 9:03 pm
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.

Posted: Thu Feb 21, 2008 9:33 pm
by ben_josephs
Or

Code: Select all

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

Posted: Thu Feb 21, 2008 10:00 pm
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

Posted: Thu Feb 21, 2008 11:00 pm
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

Posted: Mon Mar 03, 2008 10:33 pm
by djdestroyer
Thanks Ben, it worked.