remove page numbers and rejoin text

General discussions about Advanced Find and Replace
Post Reply
spotduster
Posts: 3
Joined: Sun Oct 28, 2007 4:19 am

remove page numbers and rejoin text

Post by spotduster »

I am trying to batch rejoin a book that has random text lines like the following interspersed by page numbers. The page numbers appear exactly on the same place in every line and range from single digits to into triple digits. How can I remove the page number lines, and rejoin the text that is above and below without it accidently seeing numbers in the text like dates, etc? I have figured out all the other expressions I need to add lines, etc, but I can't figure out removing and rejoining these lines. Thanks for any help you can provide!

Example:

Code: Select all

France. During the Revolution, in 1793, "the world for the first time heard an assembly of men, 
                                                                            270
born and educated in civilization, and assuming the right to govern one of the finest of the 
Needs to look like:

Code: Select all

France. During the Revolution, in 1793, "the world for the first time heard an assembly of men, born and educated in civilization, and assuming the right to govern one of the finest of the

Abacre
Site Admin
Posts: 1223
Joined: Mon Jan 31, 2005 5:32 pm

Re: remove page numbers and rejoin text

Post by Abacre »

Yes, you can do that with Advanced Find and Replace.

Go to Batch replace tab, check on "Use regular expressions".
Put into the grid, search for:
^\s+\d+\s*\r\n

Replace with:
should be empty

It will work in most probable cases. Send us a sample file to
support@abacre.ocm if it does not work.
Kind regards,
Abacre Limited
http://www.abacre.com
support@abacre.com

spotduster
Posts: 3
Joined: Sun Oct 28, 2007 4:19 am

Re: remove page numbers and rejoin text

Post by spotduster »

The page number lines are now being removed, but I need to have it pull the text from the line below, back one backspace to rejoin the text. Is there a way to enter a backspace?

Abacre
Site Admin
Posts: 1223
Joined: Mon Jan 31, 2005 5:32 pm

Re: remove page numbers and rejoin text

Post by Abacre »

Try the following:

Search for:
\r\n\s+\d+\s*\r\n

Replace with:
should be empty or put here one space.
Kind regards,
Abacre Limited
http://www.abacre.com
support@abacre.com

spotduster
Posts: 3
Joined: Sun Oct 28, 2007 4:19 am

Re: remove page numbers and rejoin text

Post by spotduster »

Thanks so much for that code, it works perfectly! This saves me countless hours of tedious work!

Post Reply