[bksvol-discuss] Re: For Lori - tricks for find and replace to get rid of parentheses around page numbers

  • From: "Lori" <lori@xxxxxxxxxxxx>
  • To: <bksvol-discuss@xxxxxxxxxxxxx>
  • Date: Sat, 2 Jan 2010 08:56:15 -0500

Hurray! I wanted to report success. Thank you so much. I will definitely put this in my folder of tricks.


Lori

----- Original Message ----- From: "Judy s." <cherryjam@xxxxxxxxxxxxxxxx>
To: <bksvol-discuss@xxxxxxxxxxxxx>
Sent: Thursday, December 31, 2009 7:57 PM
Subject: [bksvol-discuss] For Lori - tricks for find and replace to get rid of parentheses around page numbers


Hi Lori,

I had to something similar a while back with page numbers that had brackets around them. I didn't remember how I did it, so I snagged my Word Guru (aka Michael, my husband) and had him show me again.

I'm going to give you instructions on how to do this two different ways.

The first way works if there aren't any spaces between the parentheses and the numbers. The second way works if you do have any number of spaces before and or after the parentheses and your page number.

It's going to seem like magic numbers if you aren't a programmer who uses what are called "regular expressions" and wild cards, but it can be done. smile. So here's my instructions.

Before you do anything, save a copy of the file just in case, so you don't lose any of your previous work on the book.

How to do Way One. Use this way if you don't have any spaces between the parentheses and the numbers.

You use a special kind of search, using the "use wildcards" box in the find and replace dialogue.

In the Find and Replace dialogue box, click on the button that is marked "More." This will expand the options that are available in the Find and Replace box to include a new list of Search Options. In the list of Search Options, check the box for "use wildcards" (you can also do this while in the Search box by typing alt U, which is alt "capital U)

Next, in the find box, enter the following exact string:

\(([0-9]@)\)

that is, back-slash left-parentheses left-parentheses left-square-bracket zero hyphen nine right-square-bracket at-sign right-parentheses back-slash right-parentheses

In the replace box, enter the following exact string:
\1

that is backslash numeral-one

You can then execute a "replace all" or if you want to be safer (until you are sure this is working exactly right), instead execute a find and as it finds each page number in parentheses that you want to fix execute a replace each time.

Here's how to do Way Two, which will find every page number and strip the parentheses even if there are spaces in front of and-or behind the page numbers.

You use a special kind of search four times, using the "use wildcards" box in the find and replace dialogue.

In the Find and Replace dialogue box, click on the button that is marked "More." This will expand the options that are available in the Find and Replace box to include a new list of Search Options. In the list of Search Options, check the box for "use wildcards" (you can also do this while in the Search box by typing alt U, which is alt "capital U)

Next, in the find box, enter the following exact string to do search one:

\(([0-9]@)\)

that is, back-slash left-parentheses left-parentheses left-square-bracket zero hyphen nine right-square-bracket at-sign right-parentheses back-slash right-parentheses

In the replace box, enter the following exact string:
\1

that is backslash numeral-one

You can then execute a "replace all" or if you want to be safer (until you are sure this is working exactly right), instead execute a find and as it finds each page number in parentheses that you want to fix execute a replace each time.


Next, in the find box, enter the following exact string to do search two:

\( @([0-9]@)\)

that is, back-slash left-parentheses space at-sign left-parentheses left-square-bracket zero hyphen nine right-square-bracket at-sign right-parentheses back-slash right-parentheses

In the replace box, enter the following exact string:
\1

that is backslash numeral-one

You can then execute a "replace all" or if you want to be safer (until you are sure this is working exactly right), instead execute a find and as it finds each page number in parentheses that you want to fix execute a replace each time.

Next, in the find box, enter the following exact string to do search three:

\(([0-9]@) @\)

that is, back-slash left-parentheses left-parentheses left-square-bracket zero hyphen nine right-square-bracket at-sign right-parentheses space at-sign back-slash right-parentheses

In the replace box, enter the following exact string:
\1

that is backslash numeral-one

You can then execute a "replace all" or if you want to be safer (until you are sure this is working exactly right), instead execute a find and as it finds each page number in parentheses that you want to fix execute a replace each time.

Next, in the find box, enter the following exact string to do search four:

\( @([0-9]@) @\)

that is, back-slash left-parentheses space at-sign left-parentheses left-square-bracket zero hyphen nine right-square-bracket at-sign right-parentheses space at-sign back-slash right-parentheses

In the replace box, enter the following exact string:
\1

that is backslash numeral-one

You can then execute a "replace all" or if you want to be safer (until you are sure this is working exactly right), instead execute a find and as it finds each page number in parentheses that you want to fix execute a replace each time.

That's it!!

Good luck.  smile.

Judy s.



Lori wrote:
Hi all,

I just discovered that a book has parenthesis around each page number.

I'm thinking I probably need to eliminate them. I know I could do this by hand, but I'm wondering if find and replace can be exercised. For instance, can you use wildcards? I'd like to perform a find and replace for (*) (**) and (***) to make sure I get all of the page numbers. Of course, the * would be the digit. Anyone ever done this?

To unsubscribe from this list send a blank Email to
bksvol-discuss-request@xxxxxxxxxxxxx
put the word 'unsubscribe' by itself in the subject line. To get a list of available commands, put the word 'help' by itself in the subject line.


__________ Information from ESET NOD32 Antivirus, version of virus signature database 4733 (20091231) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com




To unsubscribe from this list send a blank Email to
bksvol-discuss-request@xxxxxxxxxxxxx
put the word 'unsubscribe' by itself in the subject line.  To get a list of 
available commands, put the word 'help' by itself in the subject line.

Other related posts: