Formatting index entries

S

Salty

I am polishing a 700+ page geneaology project for a client. In
generating the index, I am finding that the names are being
alphabetized by first name as marked. Makes sense, but I need it to
reverse to:

<LastName>, <FirstName> <Middle>

I looked at switches in the Fields dialogs for Index and XE, but nothing there.

Anyone know an automated solution? I have about 1000 names in one
chapter. Could be 10,000 plus in the entire volume.
 
J

John McGhie [MVP - Word and Word Macintosh]

Hi Salty:

Ahhh... That's what I like... A "challenge" :)

The following procedure will do what you want, and it takes about five extra
minutes once you know how. But make some copies and do some practice: you
may not get it right the first time!

Yours is one of the very few publications for which a Concordance File will
produce valid results :)

Let's assume that all of your text entries are First Middle Last (e.g. John
Graham McGhie)...

1) mark your index entries

2) Generate your index

3) Copy the index and paste as Unformatted Text into a blank document

4) replace each space with a tab character

5) Convert the whole thing to a table

6) delete the column containing the page numbers

7) Insert three columns to the right of the 3rd column

8) Copy Column 3 (the last names) and paste into Column 4

9) Copy column 1 (First Names) into column 5 and column 2 (Middle names)
into Column 6

10) Add a column between columns 4 and 5

11) Add a column between columns 3 and 4

12) Type a @ (or any other character that isn't used) in the first cell in
Column 4 (the blank one).

13) Copy the whole cell

14) Select cells 2 to last in that column and paste. You will have an at
sign in each cell

15) Repeat steps 12 to 14 in the other blank column to add a colon to the
right of the second Last Name column.

You should now have a table in which each line reads:

First | Middle | Last | @ | Last | : | First | Middle |

16) Select the whole thing and use Table>Convert>Table to text. Choose
"Tabs" as the separator character.

17) Now, use Edit>Replace to replace every tab with a space.

18) This is a great time to tidy up any extraneous spaces: Use Edit>Replace
to replace each instance of " " two spaces with " " one space.

19) Now use Edit>Replace to replace every @ with a tab

20) Now select all of the text and use Table>Convert>Text to Table to
convert the whole thing back into a table.

You will now have a two-column table with:
First Middle Last | Last:First Middle |

21) Save that document.

22) Make a copy of the main document and save under a new name, just in
case of accidents.

23) Now use Edit>Replace to find all tags of type XE and replace with
Nothing.

That's right, you want to rip all the Index tags out of the main document.

Now read the help CAREFULLY about Concordance Files. You have just made
one! Use it.

24) Regenerate the Index, this time using your Concordance File and no tags
at all.

The concordance file will re-tag your your document with new XE tags. The
previously tagged terms will be re-tagged with the names transposed. The
index it produces will be sorted character-for-character in transposed
collation order.

The reason you use a colon, not a comma, in the table is to produce an index
in the format:

Smith
John James
Lucy Annabel
Maureen Daisy

Tolhurst
Graham
Peter Michael

Etc...

Cheers


I am polishing a 700+ page geneaology project for a client. In
generating the index, I am finding that the names are being
alphabetized by first name as marked. Makes sense, but I need it to
reverse to:

<LastName>, <FirstName> <Middle>

I looked at switches in the Fields dialogs for Index and XE, but nothing
there.

Anyone know an automated solution? I have about 1000 names in one
chapter. Could be 10,000 plus in the entire volume.

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410
 
S

Salty

The concordance file will re-tag your your document with new XE tags. The
previously tagged terms will be re-tagged with the names transposed. The
index it produces will be sorted character-for-character in transposed
collation order.

By George! I think I've got it. I suspected that a concordance was in
my future. I'll try on one of the subdocs over the weekend a let you
know how it turned out.
 
C

Clive Huggan

By George! I think I've got it. I suspected that a concordance was in
my future. I'll try on one of the subdocs over the weekend a let you
know how it turned out.

Ahoy, Salty!

You have no idea how much you will have brightened up the day (no, make it
"week") of m'learned friend McGhie by asking your question! Challenge not
posed before; has a wonderfully elegant solution; requires some effort to
describe in logical sequence; will be used by someone who understands it and
who has the courtesy to get back... ;-)

Beats "corrupt font issues" any day, eh, John?

Clive Huggan
============
 
J

John McGhie [MVP - Word and Word Macintosh]

The only kind of question that would please me more is one that gets its own
*Chapter* in BWTYW... :)

Good luck Salty... Don't forget to make *COPIES* -- when pushing Word to
the limits, the line between "bravery" and "foolhardiness" is sometimes
invisible...

BTW: Do NOT come back asking how to do a "word by word" collation. If you
need Word by word sort order, we can do that, but you have to do it to the
Concordance File BEFORE you re-tag the document :)

There's an undocumented parameter in the XE tag that enables you to override
the sort order by specifying a "Sort As" string...

I'd have to check if it still works on the Mac...

Cheers


Ahoy, Salty!

You have no idea how much you will have brightened up the day (no, make it
"week") of m'learned friend McGhie by asking your question! Challenge not
posed before; has a wonderfully elegant solution; requires some effort to
describe in logical sequence; will be used by someone who understands it and
who has the courtesy to get back... ;-)

Beats "corrupt font issues" any day, eh, John?

Clive Huggan
============

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top