You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openoffice.apache.org by doug <dm...@optonline.net> on 2013/02/09 06:49:52 UTC

search and replace question

I have imported a relatively long document from an email, which contains 
a lot of single and double quote marks,
all of them "inch marks"--straight lines.  they need to be curly quotes 
and apostrophes. While I could and did
change the preferences (in whatever drop-down menu I found it) to use 
single and double curly quotes, it does
not automatically take place, and I dont' know how to do a search and 
replace on them, since some double
quotes are opening quotes, and some are closing quotes.  So even if I 
manually change one and then use it as
a template for the s&r, how will it know what to do?  And what about 
apostrophes, in words like "can't?"

--doug

-- 
Blessed are the peacemakers...for they shall be shot at from both sides. --A. M. Greeley


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@openoffice.apache.org
For additional commands, e-mail: users-help@openoffice.apache.org


Re: search and replace question

Posted by Rory O'Farrell <of...@iol.ie>.
On Sat, 09 Feb 2013 10:51:00 -0500
TJ Frazier <tj...@cfl.rr.com> wrote:

> On 2/9/2013 08:10, Andrew Douglas Pitonyak wrote:
> > On 02/09/2013 02:10 AM, Rory O'Farrell wrote:
> >> On Sat, 09 Feb 2013 00:49:52 -0500
> >> doug <dm...@optonline.net> wrote:
> >>
> >>> I have imported a relatively long document from an email, which contains
> >>> a lot of single and double quote marks,
> >>> all of them "inch marks"--straight lines.  they need to be curly quotes
> >>> and apostrophes. While I could and did
> >>> change the preferences (in whatever drop-down menu I found it) to use
> >>> single and double curly quotes, it does
> >>> not automatically take place, and I dont' know how to do a search and
> >>> replace on them, since some double
> >>> quotes are opening quotes, and some are closing quotes.  So even if I
> >>> manually change one and then use it as
> >>> a template for the s&r, how will it know what to do?  And what about
> >>> apostrophes, in words like "can't?"
> >>>
> >> I had to do this some years ago for several book texts, so what I say
> >> is subject to possibly faulty memory!
> >>
> >> Normally a leading quote is the sequence <space quote> and a trailing
> >> quote <quote space>, or sometimes <StartOfPara quote> <quote
> >> EndofPara>. Ditto for single quotes, apart from the apostrophe.  I
> >> normally type a short line to generate sample curly quotes so I can
> >> Copy and Paste these into the Replace box.  My memory is that Find and
> >> Replace in OOo 3.x did not accept characters direct from /Insert
> >> /Special Characters, so I used this work around; this may have changed
> >> in AOo 3.4.x.
> >>
> >> I then was able to use a few Find and Replace sequences to change an
> >> entire text.  I think I actually used AltSearch in place of Find and
> >> Replace for the last texts. I did have to check the texts for
> >> anomalies - there were a few, but these were picked up quickly in a
> >> proof-reading scan; I converted several book length texts in a matter
> >> of a few minutes each.
> >>
> >> If you decide to use this method, do please keep an unmodified backup,
> >> as global Find and Replaces can quickly be disastrous until you get
> >> the hang of them.
> >>
> >> it may be possible to do all this with either a macro or Regular
> >> Expressions. I have no great experience with either.
> > Step 1: Turn change tracking on.
> >
> > Step 2: Do your magic to make the changes, what ever that may be.
> >
> > Step 3: Review your changes, which would hopefully be rather quick.
> >
> > You can probably do a safe search and replace by finding all spaces
> > followed by a " and replace with a space followed by a curl-to-the-right
> > double quote. You know, low hanging fruit and all. Same with " followed
> > by a space. Just looking for some short cuts if you wanted to use search
> > and replace.
> >
> After you do the bulk of the conversion, perhaps using some of the 
> preceding excellent advice, you might find my "QuoteChecker" macro of 
> use. It will catch stray "inch marks", and should detect unbalanced or 
> missing curly double quotes. (Sorry, no help for single quotes: with 
> exceptions like "'Twas the ..." and "'Course you can", the logic gets 
> very complex.) If you're interested, I'll clean up the macro and post it 
> on the wiki.
> 
> BTW, you can insert special characters into dialog fields (like s&r) 
> with Ctrl-Shift-S, to open the Special Characters dialog. The curly 
> quotes are up at U+2018, 19, 1B, and 1C.

I normally use a sneaky trick to find the unconverted single quotes. After the main conversion has been done I F&R a single straight quote, replacing it with a single straingt quote, in bright red, size (say) 26pt.  This stands out like a sore thumb on full page views, and it is simple to run through the document and hand patch the few occurences of an unconverted single quote, usually in contexts such as suggested above.  Back in SO8, OOo2.x and 3.x days I could not easily get F&R to accept a character selected from Special Characters and it was quicker to put a line in the text with any needed Special Charaters and Copy and Paste them into F&R.  My priority was and is always to get the job done, even if inelegantly.  Once it is finished, no one cares how it was done!
-- 
Rory O'Farrell <of...@iol.ie>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@openoffice.apache.org
For additional commands, e-mail: users-help@openoffice.apache.org


Re: search and replace question

Posted by TJ Frazier <tj...@cfl.rr.com>.
On 2/9/2013 10:51, TJ Frazier wrote:
> On 2/9/2013 08:10, Andrew Douglas Pitonyak wrote:
>> On 02/09/2013 02:10 AM, Rory O'Farrell wrote:
>>> On Sat, 09 Feb 2013 00:49:52 -0500
>>> doug <dm...@optonline.net> wrote:
>>>
>>>> I have imported a relatively long document from an email, which
>>>> contains
>>>> a lot of single and double quote marks,
>>>> all of them "inch marks"--straight lines.  they need to be curly quotes
>>>> and apostrophes. While I could and did
>>>> change the preferences (in whatever drop-down menu I found it) to use
>>>> single and double curly quotes, it does
>>>> not automatically take place, and I dont' know how to do a search and
>>>> replace on them, since some double
>>>> quotes are opening quotes, and some are closing quotes.  So even if I
>>>> manually change one and then use it as
>>>> a template for the s&r, how will it know what to do?  And what about
>>>> apostrophes, in words like "can't?"
>>>>
>>> I had to do this some years ago for several book texts, so what I say
>>> is subject to possibly faulty memory!
>>>
>>> Normally a leading quote is the sequence <space quote> and a trailing
>>> quote <quote space>, or sometimes <StartOfPara quote> <quote
>>> EndofPara>. Ditto for single quotes, apart from the apostrophe.  I
>>> normally type a short line to generate sample curly quotes so I can
>>> Copy and Paste these into the Replace box.  My memory is that Find and
>>> Replace in OOo 3.x did not accept characters direct from /Insert
>>> /Special Characters, so I used this work around; this may have changed
>>> in AOo 3.4.x.
>>>
>>> I then was able to use a few Find and Replace sequences to change an
>>> entire text.  I think I actually used AltSearch in place of Find and
>>> Replace for the last texts. I did have to check the texts for
>>> anomalies - there were a few, but these were picked up quickly in a
>>> proof-reading scan; I converted several book length texts in a matter
>>> of a few minutes each.
>>>
>>> If you decide to use this method, do please keep an unmodified backup,
>>> as global Find and Replaces can quickly be disastrous until you get
>>> the hang of them.
>>>
>>> it may be possible to do all this with either a macro or Regular
>>> Expressions. I have no great experience with either.
>> Step 1: Turn change tracking on.
>>
>> Step 2: Do your magic to make the changes, what ever that may be.
>>
>> Step 3: Review your changes, which would hopefully be rather quick.
>>
>> You can probably do a safe search and replace by finding all spaces
>> followed by a " and replace with a space followed by a curl-to-the-right
>> double quote. You know, low hanging fruit and all. Same with " followed
>> by a space. Just looking for some short cuts if you wanted to use search
>> and replace.
>>
> After you do the bulk of the conversion, perhaps using some of the
> preceding excellent advice, you might find my "QuoteChecker" macro of
> use. It will catch stray "inch marks", and should detect unbalanced or
> missing curly double quotes. (Sorry, no help for single quotes: with
> exceptions like "'Twas the ..." and "'Course you can", the logic gets
> very complex.) If you're interested, I'll clean up the macro and post it
> on the wiki.
>
> BTW, you can insert special characters into dialog fields (like s&r)
> with Ctrl-Shift-S, to open the Special Characters dialog. The curly
> quotes are up at U+2018, 19, 1B, and 1C.
>
> HTH,
> /tj/
>
On request, I have posted the macro on the wiki[1].

[1] <http://wiki.openoffice.org/wiki/User:TJFrazier/Quotes>
/tj/



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@openoffice.apache.org
For additional commands, e-mail: users-help@openoffice.apache.org


Re: search and replace question

Posted by TJ Frazier <tj...@cfl.rr.com>.
On 2/9/2013 08:10, Andrew Douglas Pitonyak wrote:
> On 02/09/2013 02:10 AM, Rory O'Farrell wrote:
>> On Sat, 09 Feb 2013 00:49:52 -0500
>> doug <dm...@optonline.net> wrote:
>>
>>> I have imported a relatively long document from an email, which contains
>>> a lot of single and double quote marks,
>>> all of them "inch marks"--straight lines.  they need to be curly quotes
>>> and apostrophes. While I could and did
>>> change the preferences (in whatever drop-down menu I found it) to use
>>> single and double curly quotes, it does
>>> not automatically take place, and I dont' know how to do a search and
>>> replace on them, since some double
>>> quotes are opening quotes, and some are closing quotes.  So even if I
>>> manually change one and then use it as
>>> a template for the s&r, how will it know what to do?  And what about
>>> apostrophes, in words like "can't?"
>>>
>> I had to do this some years ago for several book texts, so what I say
>> is subject to possibly faulty memory!
>>
>> Normally a leading quote is the sequence <space quote> and a trailing
>> quote <quote space>, or sometimes <StartOfPara quote> <quote
>> EndofPara>. Ditto for single quotes, apart from the apostrophe.  I
>> normally type a short line to generate sample curly quotes so I can
>> Copy and Paste these into the Replace box.  My memory is that Find and
>> Replace in OOo 3.x did not accept characters direct from /Insert
>> /Special Characters, so I used this work around; this may have changed
>> in AOo 3.4.x.
>>
>> I then was able to use a few Find and Replace sequences to change an
>> entire text.  I think I actually used AltSearch in place of Find and
>> Replace for the last texts. I did have to check the texts for
>> anomalies - there were a few, but these were picked up quickly in a
>> proof-reading scan; I converted several book length texts in a matter
>> of a few minutes each.
>>
>> If you decide to use this method, do please keep an unmodified backup,
>> as global Find and Replaces can quickly be disastrous until you get
>> the hang of them.
>>
>> it may be possible to do all this with either a macro or Regular
>> Expressions. I have no great experience with either.
> Step 1: Turn change tracking on.
>
> Step 2: Do your magic to make the changes, what ever that may be.
>
> Step 3: Review your changes, which would hopefully be rather quick.
>
> You can probably do a safe search and replace by finding all spaces
> followed by a " and replace with a space followed by a curl-to-the-right
> double quote. You know, low hanging fruit and all. Same with " followed
> by a space. Just looking for some short cuts if you wanted to use search
> and replace.
>
After you do the bulk of the conversion, perhaps using some of the 
preceding excellent advice, you might find my "QuoteChecker" macro of 
use. It will catch stray "inch marks", and should detect unbalanced or 
missing curly double quotes. (Sorry, no help for single quotes: with 
exceptions like "'Twas the ..." and "'Course you can", the logic gets 
very complex.) If you're interested, I'll clean up the macro and post it 
on the wiki.

BTW, you can insert special characters into dialog fields (like s&r) 
with Ctrl-Shift-S, to open the Special Characters dialog. The curly 
quotes are up at U+2018, 19, 1B, and 1C.

HTH,
/tj/



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@openoffice.apache.org
For additional commands, e-mail: users-help@openoffice.apache.org


Re: search and replace question

Posted by Andrew Douglas Pitonyak <an...@pitonyak.org>.
On 02/09/2013 02:10 AM, Rory O'Farrell wrote:
> On Sat, 09 Feb 2013 00:49:52 -0500
> doug <dm...@optonline.net> wrote:
>
>> I have imported a relatively long document from an email, which contains
>> a lot of single and double quote marks,
>> all of them "inch marks"--straight lines.  they need to be curly quotes
>> and apostrophes. While I could and did
>> change the preferences (in whatever drop-down menu I found it) to use
>> single and double curly quotes, it does
>> not automatically take place, and I dont' know how to do a search and
>> replace on them, since some double
>> quotes are opening quotes, and some are closing quotes.  So even if I
>> manually change one and then use it as
>> a template for the s&r, how will it know what to do?  And what about
>> apostrophes, in words like "can't?"
>>
> I had to do this some years ago for several book texts, so what I say is subject to possibly faulty memory!
>
> Normally a leading quote is the sequence <space quote> and a trailing quote <quote space>, or sometimes <StartOfPara quote> <quote EndofPara>. Ditto for single quotes, apart from the apostrophe.  I normally type a short line to generate sample curly quotes so I can Copy and Paste these into the Replace box.  My memory is that Find and Replace in OOo 3.x did not accept characters direct from /Insert /Special Characters, so I used this work around; this may have changed in AOo 3.4.x.
>
> I then was able to use a few Find and Replace sequences to change an entire text.  I think I actually used AltSearch in place of Find and Replace for the last texts. I did have to check the texts for anomalies - there were a few, but these were picked up quickly in a proof-reading scan; I converted several book length texts in a matter of a few minutes each.
>
> If you decide to use this method, do please keep an unmodified backup, as global Find and Replaces can quickly be disastrous until you get the hang of them.
>
> it may be possible to do all this with either a macro or Regular Expressions. I have no great experience with either.
Step 1: Turn change tracking on.

Step 2: Do your magic to make the changes, what ever that may be.

Step 3: Review your changes, which would hopefully be rather quick.

You can probably do a safe search and replace by finding all spaces 
followed by a " and replace with a space followed by a curl-to-the-right 
double quote. You know, low hanging fruit and all. Same with " followed 
by a space. Just looking for some short cuts if you wanted to use search 
and replace.

-- 
Andrew Pitonyak
My Macro Document: http://www.pitonyak.org/AndrewMacro.odt
Info:  http://www.pitonyak.org/oo.php


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@openoffice.apache.org
For additional commands, e-mail: users-help@openoffice.apache.org


Re: search and replace question

Posted by Rory O'Farrell <of...@iol.ie>.
On Sat, 09 Feb 2013 00:49:52 -0500
doug <dm...@optonline.net> wrote:

> I have imported a relatively long document from an email, which contains 
> a lot of single and double quote marks,
> all of them "inch marks"--straight lines.  they need to be curly quotes 
> and apostrophes. While I could and did
> change the preferences (in whatever drop-down menu I found it) to use 
> single and double curly quotes, it does
> not automatically take place, and I dont' know how to do a search and 
> replace on them, since some double
> quotes are opening quotes, and some are closing quotes.  So even if I 
> manually change one and then use it as
> a template for the s&r, how will it know what to do?  And what about 
> apostrophes, in words like "can't?"
> 
I had to do this some years ago for several book texts, so what I say is subject to possibly faulty memory! 

Normally a leading quote is the sequence <space quote> and a trailing quote <quote space>, or sometimes <StartOfPara quote> <quote EndofPara>. Ditto for single quotes, apart from the apostrophe.  I normally type a short line to generate sample curly quotes so I can Copy and Paste these into the Replace box.  My memory is that Find and Replace in OOo 3.x did not accept characters direct from /Insert /Special Characters, so I used this work around; this may have changed in AOo 3.4.x.  

I then was able to use a few Find and Replace sequences to change an entire text.  I think I actually used AltSearch in place of Find and Replace for the last texts. I did have to check the texts for anomalies - there were a few, but these were picked up quickly in a proof-reading scan; I converted several book length texts in a matter of a few minutes each.  

If you decide to use this method, do please keep an unmodified backup, as global Find and Replaces can quickly be disastrous until you get the hang of them.

it may be possible to do all this with either a macro or Regular Expressions. I have no great experience with either.  
-- 
Rory O'Farrell <of...@iol.ie>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@openoffice.apache.org
For additional commands, e-mail: users-help@openoffice.apache.org


Re: search and replace question

Posted by Brian Barker <b....@btinternet.com>.
At 00:49 09/02/2013 -0500, Doug McGarrett wrote:
>I have imported a relatively long document from an email, which 
>contains a lot of single and double quote marks, all of them "inch 
>marks"--straight lines.  They need to be curly quotes and 
>apostrophes. While I could and did change the preferences (in 
>whatever drop-down menu I found it) to use single and double curly 
>quotes, it does not automatically take place, and I don't know how 
>to do a search and replace on them, since some double quotes are 
>opening quotes, and some are closing quotes.

Go to Format | AutoCorrect > | Apply or to Format | AutoCorrect > | 
Apply and Edit Changes.  You may want to select options at Tools | 
AutoCorrect Options... before you do this.  Alternatively, you may 
want to do this before you carry out other formatting, so that you 
can reverse any additional changes you do not want.  This procedure 
will affect material only in the Default paragraph style.

I trust this helps.

Brian Barker


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@openoffice.apache.org
For additional commands, e-mail: users-help@openoffice.apache.org