Results 1 to 8 of 8
  1. #1
    3 Star Lounger
    Join Date
    Feb 2001
    Posts
    262
    Thanks
    0
    Thanked 0 Times in 0 Posts

    wildcard find&replace (2000)

    How can I find a string with any digit followed by a right paren -- (e.g. 1999) or 2001) -- and then put a carriage return (^p) after that string? I'm trying to marke all the citations in a doc and copy just the citations out to another file. This is the first step in doing that -- the citations look like Smith and Jones (1977), or Smith et al. (2000), or just Smith (1845). Are there better ways to do this? I can't determine how to locate the beginning of the citation as a string, since it is variable in length. Thanks!

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: wildcard find&replace (2000)

    Hi Randy:

    Have you tried the MarkCitations dialog box? That's the whole purpose of the Table of Authorities.

    1. Place your cursor at the beginning of the document.
    2. Press Alt+Shift+I. This opens the mark citation box.
    3. Press the next citation button. It should jump to the next citation.
    4. Click mark or mark all. You might have to click in the document to select more text first.

    When you're done, just go to Insert/Index and Tables/Table of Authorities tab & create your table. If you want a permanent copy (i.e. not a field), you can select the TOA & press Ctrl+Shift+F9 to unlink it. You can then copy & print it.

    Hope this helps.

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: wildcard find&replace (2000)

    You can do what you want with this Find and Replace:

    <table border=1><td>Find: </td><td>([0-9]{4}))</td><td>Replace: </td><td>1^13</td></table>

    If you have not used wildcard search before, the way to understand this is English is:

    Find four consecutive numeric digits followed by a close parenthesis, and replace all of that with what you found plus a paragraph break. In order to refer to the found stuff in your replace text, you need to surround it in parentheses. The first set of parentheses is referred to in the replace text as 1, the second as 2, and so forth. In order to find a close parenthesis, which normally is interpreted to mean a grouping, precede with with a backslash, to tell Word to take it literally.

    Now... rather than insert all these line breaks, maybe you can start with the find and then develop a macro that will scoop out the citations and lay them into a second document automatically. In <A target="_blank" HREF=http://www.wopr.com/cgi-bin/w3t/showflat.pl?Cat=&Board=wrd&Number=72358>this thread over here</A>, we came up with a way to do that for e-mail addresses. All you need to do is figure out the "boundary" characters for the beginning of a citation (whether it be a period from the end of the previous sentence, etc.). Even if you grab a little too much, you'll be way ahead of cutting and pasting them manually. Unless you count programming time, but a true hacker never does. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

  4. #4
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ctrl shift f9 in table

    ctrl shift f9 in table

    I have only just discovered that Ctrl-Shift-F9 appears not to work (Word97SR2) when several contiguous cells of a Word table are selected.

    I can select the {Hyperlink} and Ctrl-Shift-F9 it to fix the text, but must do it one cell at a time.

  5. #5
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ctrl shift f9 in table

    Hi Chris:
    Right you are. And even in one cell, you can't select the entire cell & have it work. Haven't tried this in any later version, yet. Couldn't find anything on the knowledge base.

  6. #6
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: wildcard find&replace (2000)

    For the original question, a simple (non-wildcard) search for ^#^#^#^#), replace with ^&^p would have worked, too.

    In the German version, "Mark Citation" isn't properly supported, so I don't know how well the "Next" button in that dialog works.

    A wildcard search could help you to locate citations:
    Find: <[A-Za-z ]{2,20}([0-9]{4})
    would select a year in parentheses, and the words preceeding it (length 2 to 20 characters, starting with a new word).

    If you record this as a macro, you could add the line
    <pre>Selection.StartIsActive = Not (Selection.StartIsActive)</pre>

    at the end of the macro. This would allow you to move the start of the selection after the macro has run (while holding the Shift and Control keys to change the selection by words).

    After you are done selecting the citation, you could bring up the dialog for the table of authorities.

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>Regards, Klaus

  7. #7
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ctrl shift f9 in table

    Hi Chris:
    Noticed something new in Word 2000, that I didn't try in Word 97.
    It doesn't unlink if you:
    1. Select one or more contiguous cells & press Ctrl+Shift+F9.
    2. Place the cursor to the right of any row & use shift+left arrow to select cells.

    It does unlink if you press Ctrl+Shift+F9 after you:
    1. Select an entire row using the mouse by clicking in the left margin (even though the selection resembles (2.) above.

    2. Select the entire table (e.g. Alt+double click in the table).

    I didn't try these things in Word97.

  8. #8
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ctrl shift f9 in table

    > I didn't try these things in Word97.


    I did. They still work there.

    Or, by taking a forward looking view, whataver aberrant behaviour existed in Word97 ...


    BTW your business of clicking to the right of the rightmost cell in a row can select either a character position or a potentially new column, depending on the position of the mouse. In either case (Word97SR2) Shift-leftarrow results in Row selection, never cell selection, as far as I can see.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •