Hi, Paul!
quote:
I should have been clearer. Tried that, but despite putting in hard spaces
between first and last name, and doing sort by first word of paragraph, it
doesn't do alphabetical order, at least not for the whole list.
end
I think you could have been even more clearer. <g> Anyway, assume that
the
structure of your "address list" consists of names and addresses
separated from
one another by two [HRt]s, like this:
Fred Flintstone
123 Bedrock Ave.
Bedrock, CA 99999
Barney Rubble
124 Bedrock Ave.
Bedrock, CA 99999
Michael "Bam-Bam" Rubble
124 Bedrock Ave.
Bedrock, CA 99999
Betty and Barney Rubble
124 Bedrock Ave.
Bedrock, CA 99999
If the names in any of your addresses should contain a subtitle, like
"Jr.,"
"Ph.D" or "Esq.," in the first line of each address, you
need to know that the
sort will be off-kilter, since WP treats the last word on a first line of each
such address as if they were the last name, but later in this message I will
show you how you should handle these "subtitles" when initiating a
paragraph
sort.
Do a Tools | Sort, or invoke Sort using Alt+F9, and after choosing to sort by
"First word in a paragraph," click the "Edit" button and
create two sort keys
(both keys must be of type "Alpha") by clicking the "Add Key at
End" button
once so that there are two sort keys available. Key1 and Key2 should
essentially be the same, except Key1 should be set to sort on the /last/ word
on the first line of each of your addresses, which is expressed by defining
Key1 as "Line 1, Field 1, Word -1" while Key2 should sort on the
/first/ word
of the first line of each of these addresses, which is expressed by defining
Key2 as "Line 1, Field 1, Word 1."
Put another way, you will need to create the following sorting rules (keys) for
the paragraph sort:
(Last name)
(Key) (Type) Alpha (Sort order) Ascending (Line) 1 (Field) 1 (Word) -1
(First name)
(Key) (Type) Alpha (Sort order) Ascending (Line) 1 (Field) 1 (Word) 1
When WP performs a sort operation, it manipulates objects called
"records," and
a record is defined according to the /type/ of record -- line, paragraph, merge
record, table row and parallel column row -- and each of these are record
types, and a sort operates on the data in a particular record according to its
type. For example, when sorting merge records, a "field" is delimited
by tabs,
indents, a flush right and a center code, and a "line" is delimited by
a hard
return or a soft return. In a paragraph sort (as is the case in /all/ sort
operations, a "word" is delimited by spaces, forward slashes and
dashes.
Should a name include a subtitle, like Ph.D., you would want WP to ignore the
space character that would normally follow the comma and precedes the
"P" as if
the subtitle and the last name that precedes it were a single word. This is
accomplished by substituting a Hard Space (invoked using the Ctrl-Space
shortcut) for the regular space character that separates the last name from the
subtitle.
Note the following examples, the first two of which contain a "#"
character to
signify a Hard Space that was inserted in place of a regular space:
Barney Rubble,#Jr.
124 Bedrock Ave.
Bedrock, CA 99999
Jessica G. Rio-Williams,#Ph.D.
1234 Main Avenue
New York, NY 10001
Since WP treats the last word on a first line of an address in a paragraph sort
as if it were the last name, it's important to know that WP distinguishes a
dash, also known as the Hard Hyphen (invoked using the Ctrl-Hyphen keyboard
shortcut), from the Hyphen character (invoked by pressing the Hyphen key), in
that unlike the Hyphen, which is ignored during a sort operation, the dash is
considered a "word delimiter."
You would, therefore, need to create the following sorting rules (keys)
including a third key (to handle the sorting of a middle name, if any) for the
paragraph sort :
(Last name)
(Key) (Type) Alpha (Sort order) Ascending (Line) 1 (Field) 1 (Word) -1
(First name)
(Key) (Type) Alpha (Sort order) Ascending (Line) 1 (Field) 1 (Word) 1
(Middle name)
(Key) (Type) Alpha (Sort order) Ascending (Line) 1 (Field) 1 (Word) 2
There's one more thing I should mention: Unlike the second one of the two
addresses (above), with respect to the following address --
Alexander#&#Jessica Rio-Williams
1234 Main Avenue
New York, NY 10001
-- it is important that WP be made to "know" that
"Rio-Williams" is a /single/
word and that it not consider "Rio-" and "Williams" to be
two separate words.
This is accomplished by substituting a Hard Hyphen for the Hyphen. Note, also,
the "#" characters signifying a Hard Space inserted in place of
regular spaces
since neither "&" nor "Jessica" should be sorted by the
"Middle Name" key as if
either were such.
Peace
--
Karl M. Rowe, Consultant
Email: wpconsulting@earthlink.net
WWW : http://www.wpconsulting.com
(WP Consulting Home Page)
US Mail: 8726 S. Sepulveda Blvd. #A62
Los Angeles, CA 90045-4023
Phone: (213) 365-8051
Fax : (310) 943-1983
|