[bksvol-discuss] Re: For Sue - how to use find and replace to get rid of double dashes around page numbers

  • From: Debby Franson <the.bee@xxxxxxxxxxx>
  • To: bksvol-discuss@xxxxxxxxxxxxx
  • Date: Sun, 03 Jan 2010 22:43:09 -0600

Hi Judy S.!

This one joins my other Help Desk messages that I have been collecting since I joined the list that answered my questions or other's questions that I might need in the future.

Debby

At 07:09 PM 12/31/2009, Judy s. wrote
Hi Sue,

Just saw that you had the same problem as Lori, but with a different character around the page numbers. Smile. So I'll give you the same instructions I just posted for Lori, but customized for two dashes (i.e. two hyphens).

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 hyphens and the numbers. The second way works if you do have any number of spaces before and or after the hyphens 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 hyphens 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 hyphen hyphen left-parentheses left-square-bracket zero hyphen nine right-square-bracket at-sign right-parentheses back-slash hyphen hyphen

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 hyphen hyphen left-parentheses left-square-bracket zero hyphen nine right-square-bracket at-sign right-parentheses back-slash hyphen hyphen

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.


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

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

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

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.

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

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

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

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.

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

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

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

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.

That's it!!

Good luck.  smile.

Judy s.

siss52 wrote:
Hi Lori,
I am wondering the same thing. The book I am working on has dashes, (double hyphens) around page numbers and it is tedious getting rid of the dashes by hand.
Sue S.

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.



No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.722 / Virus Database: 270.14.123/2594 - Release Date: 12/30/09 01:27:00


        --
mailto:<the.bee@xxxxxxxxxxx>
--
Enjoy what you have rather than desiring what you don't have. Just dreaming about nice things is meaningless; it is like chasing the wind.--Ecclesiastes 6:9 NLT

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: