Home | Tips | Library | Other Authors | Other WP Sites | Writer's Links | Contact | Site Map | Donate

Barry MacDonnell's
Toolbox for WordPerfect

Macros, tips, and templates for Corel® WordPerfect® for Windows®
© Copyright 1996-2024 by Barry MacDonnell. All Rights Reserved.

Page updated Jul 30, 2023

WordPerfect Tips
Main tips page | Browse more tips
How to use the Sort feature - some tips and examples

Before you begin

Examples:

Sort on the first word on each item in a list

Sort on the second word on each item in a list (such as a list of titles that all begin with "The")

Sort on the last (significant) word on each item in a list such as the last name on FirstName_Lastname lists.

Do a Line sort on first..ninth words on each item using a macro.

Sorting a table

Table as a tool: Sorting on the second column of a table

Table as a tool: Using a table to sort regular paragraphs in reverse order

Related tips on other pages:

Table as a tool: Sorting and converting existing merged address labels (by last name, by ZIP code, etc.)

•  Table tips: Using WordPerfect Tables










[Note: The first group of these methods refers to typical (manual) methods of sorting. Scroll down for methods that use macros or table columns to sort.]

WordPerfect's Sort feature can be useful to sort lines, paragraphs, labels -- or even parallel column rows, table rows, or merge data records.

You can access Tools, Sort on any <WordPerfect> menu. (If you don't see it, you might have enabled a <Microsoft Word> menu; try choosing a <WordPerfect> menu on the Tools, Settings, Customize, Menus tab.)

Don't forget to review WordPerfect's own help file (F1 key: search for "sorting").

See the examples below and the links in the left sidebar.


BEFORE you begin here are some tips and cautions.


•  Always make a backup
of your document before sorting, just in case.

•  Single lines vs. paragraphs.

- A list of just names, titles, etc., should have a single hard return ([HRt]) at the end of each line. Thus you can sort them by line.

- Similarly, blocks of wrapped text (i.e., several lines ending with soft returns [SRt]) where the last line ends with a single hard return can be sorted by line. If they end with two or more hard returns (or a hard page break [HPg]) they will be sorted by paragraph.

- If the list is in multi-line format (e.g., name/address labels, where some lines in the items should not be included in the sort) then each paragraph should be separated with two hard returns (or a hard page break [HPg]).

•  Codes in brackets (e.g., [HRt], [SRt], etc.) below are text representations of WordPerfect codes visible in the Reveal Codes window.

• 
If the items are not in a separate document with no other text, be sure to select the items before sorting them.

Selecting the text tells WordPerfect exactly which items you wish to sort.

•  Indented, outlined, flush right lines or other lines with "leading" format codes.

If you have indented, tabbed, outline numbered or bulleted, flushed right, or adjusted lines or paragraphs in your list, be aware the format codes responsible for these adjustments to text (or codes applied to the beginning of each line item) can cause WordPerfect to count them as fields in a sort.

Thus the field number specified in the Sort dialog's sort keys (i.e., the sorting rules — the default for the Field is "1") in the examples below might be incorrect.
[See also the next items in the paragraphs below about codes.]

Solutions:


- Use Reveal Codes to determine how many such "fields" are at the beginning of each line in your list, and adjust the number in the "Field" mentioned in the examples below.

For example, a number or bullet outline might require a New sort key using a field number of 2 to allow sorting the selected items on the first word (1) on each of the lines. (For most other sorts the key's field can be 1.)

- Another method described on the Lists page (here) is to use a table to convert the lines or paragraphs into a 1-column table, sort the table on the first line/paragraph, then remove the table structure (but not the table contents). This should produce a sorted list very quickly and easily.

•  Lines that begin with quote marks. Need to sort words or paragraphs that begin with quote marks but should be sorted by the first text character, not the quote mark? Here's a tip by Noal Mellot on WordPerfect Universe:

"...Unfortunately, [an] alphabetical sort is not purely alphabetical, since punctuation marks and symbols at the start of a word introduce a degree of disorder. Let's say quote marks are keeping you from obtaining the sorting results you expect when sorting on the first word in a field. A macro could search for the initial quote mark, delete it, search for the final quote mark, delete it, space, then type a symbol (such as a spade) as a signal that the preceding word should be surrounded by quote marks. You could then sort normally on the first word. Once the sorting is done, another macro could search for the symbol, delete it with its space, back up to the end of the preceding word, type a quote mark, then move to the start of the word and type a quote mark."

•  Other format codes such as [Bold] or [Italc] or [Und] that are applied to the beginning of the text string on any given line can cause WordPerfect to place these codes at inappropriate locations during a sort, causing unwanted changes in such formatting in the final sorted list.

Solution: Place an "empty" item at the top of the list (i.e., a single hard return) and include it when you sort the list of items. [N.B.: This appears to be a small bug that has existed since at least WordPerfect 8, up through WPX5/service pack 2 (at the original time of this post).]

•  Hidden text.

Text that might otherwise be used as a sort key item (e.g., the first word in a line or paragraph) will not be "seen" by the sort feature if you mark it hidden. This might be a useful way to temporarily remove the word(s), punctuation, etc., from being considered by the sort feature. Just apply the Hidden attribute (e.g., with Format, Font, Hidden) to the items; hide the items by un-checking the View, Hidden Text option; perform the sort; then show the hidden text by enabling that View menu option.

•  Length of items.

Tests on some early versions of WordPerfect by several WordPerfect Universe members indicate that sorting by Line works on numerical words up to and including the 14th digit, and on alphabetical words up to and including the 19th character. (See thread here. Note that earlier versions of WordPerfect may be even more limited.)

This word limit can be particularly problematic if the word is the first word in the line.

UPDATE (April 2019):

Using WordPerfect X9 in tests, the length of a word using a Line sort
now seems to be much longer (160 characters in one user's test), as noted in a post on WordPerfect Universe here. Hence the length of items might only be limited in some earlier versions of the program. You can test your version by Line sorting several identical strings -- except for the last character, which initially should be in random order compared to other strings -- and each string ending in a hard return ([HRt]).

•  Size of list.

According to some reports, the WordPerfect program (at least up to WPX4 (build 14.0.0.756)) may limit the number of items it can sort to 32K of memory. This seems true of paragraph sorting, and may be true of line sorting.

• Number of sorting rules (sort Keys).

While probably a very rare situation for most users it might be possible to run up against a limit to the number of "Sort by" rules -- a.k.a. sort keys -- that can be defined in Tools, Sort. (See examples below about defining custom sort keys.)

An old post on WordPerfect Universe (here) by a user of WordPerfect 11 found that the number of sort keys that can be defined is limited to about 50. The program typically ships with 7 predefined sort keys, but trying to set up 50 or more caused the "New" and "Copy" buttons on the Sort dialog to become grayed out and unavailable to create more keys.

[Sort keys are stored in the Windows registry, so this might be the cause of the 50-key limitation. I have not tested this issue, hence it is reported here simply as a user reference should the situation exist on some systems.]

 

EXAMPLES


... This example is the most common type of sort:


EXAMPLE 1: Sort on the first word on each item in a list (the most common type of sort).


1. Click on Tools, Sort. This opens the Sort dialog.

2. Choose one of the standard sort keys, such as "First word in a line" (if each item ends with a single hard return), or "First word in a paragraph" (if each item ends with two hard returns or a hard page break).

Tips

☼  If you want to sort on both the first word and the second word, third word, etc., in case you have duplicate first (and possibly second) words, you'll need to create custom Keys #2, Key #3, etc., with a different number (e.g., 2, 3, etc.) in their "Word" fields.  See the examples below that show how to add custom sorting Keys.

☼  As noted in the "Before you begin..." section above, lines to be sorted that begin with format codes — including automatic Outline entry numbers and bullets (which are created with format codes) — are considered to have separate fields before the first word on their lines.

Hence, to (e.g.) sort a numbered or bulleted Outline, try using a custom sort Key #1 with its Field set to 2 and its Word set to 1. [Outline entries will automatically be renumbered after the Sort.]

☼  Each part of an Internet address (URL) that is separated by a slash mark is a "word" to the sort function, so additional custom keys are useful to sort them correctly.

☼  More help? See the Help button on the Sort dialog, or use Help, Reference Center on the WordPerfect main menu and search for "Sort".

3.
You may want to click the Options button to "Allow Undo after sorting" and/or "Uppercase sorts before lower case". Most users will accept all other program defaults in that dialog, but feel free to modify them.

4. Click Sort.

... The next examples show how to CREATE a new custom "sort key" if you don't already have one for your particular sort needs. You can also use the Edit button in the Sort dialog to MODIFY an existing sort key.

EXAMPLE 2: Sort on the second word on each item in a list (such as a list of titles that all begin with "The")
. (You can also sort on the first word and then sort on the second word. See the Tip below.)

1. Click on Tools, Sort. This opens the Sort dialog.

2. Click on the New button to open the New Sort dialog.

3. In the "Sort Description" field, enter a name (e.g., "Sort by second word").

4. Click the Sort by Line radio button. [Note: If the list is in multi-line format — e.g., name/address labels — with each item in the list separated with two hard returns (or a hard page break [HPg]), then use the Sort by Paragraph radio button.]

5. Under "Keys (sorting rules)":

•  For Line sorts: For Key 1, "Field": enter "1" (without quotes); for "Word": enter "2" (without quotes).

•  For Paragraph sorts: For Key 1, "Line": enter "1" (without quotes); "Field": enter "1" (without quotes); for "Word": enter "2" (without quotes).

•  For "Sort order" you should choose Ascending if you want the sort to be a-z.

6. Click OK to dismiss the New Sort dialog and return to the Sort dialog.

7. You may want to click the Options button to "Allow Undo after sorting" and/or "Uppercase sorts before lower case". Most users will accept all other defaults in that dialog, but feel free to modify them.

8. Click Sort.

Tip

You can sort on BOTH the 1st word and the 2nd word — or even on each of the first 9 words (the maximum number).

In step #5 above ("Keys...") just
create a key for each word (1 through 9) for that named sort rule. That is, the rule would contain 9 keys.

For a macro that can do this (using a Line sort as the example) see Example #4 below.


EXAMPLE 3: Sort on the last (significant) word on each item in a list such as the last name on FirstName_Lastname lists.

Tips

¤  Before sorting, attach any suffixes such as Jr., III, PhD., etc., to the last name with a hard space (Ctrl+spacebar) so that WordPerfect sees the surname and the suffix as a single word. This can be done manually by replacing each such space with a hard space, or a bit more easily with Find and Replace, using the Replace..Codes button to insert a [HSpace] code in the Replace with field. Hence, for example: Search for <space>Esq. and replace with [HSpace]Esq.

¤  If the words (e.g., surnames, nine-digit ZIP codes, etc.) you wish to sort on might be hyphenated with "hard" hyphens (i.e., the "-" hyphen character, not the regular [- Hyphen] code), you should first convert them to regular hyphen codes. Otherwise, WordPerfect will see the hyphenated word as two words. To convert them: Go to the top of the document, use Edit, Find and Replace, and type a Ctrl+hyphen in the Find field and type just a hyphen ([- Hyphen] code) in the Replace field. Then use Find Next to examine each found item (in Reveal Codes) to see if it should be replaced.

¤  If you wish addresses to sort on a ZIP code, the addresses should all be the same basic paragraph format, such as all paragraphs having three (or whatever number of) lines. Then you can use the Paragraph sort below, and use the correct line number (e.g., 3) in the Line field that the ZIP code is on in your labels. (See also the tip above on hyphens.)

1. Click on Tools, Sort. This opens the Sort dialog.

2.
Click on the New button to open the New Sort dialog.

3.
In the "Sort Description" field, enter a name (e.g., "Sort by last word").

4.
Click the Sort by Line radio button. [Note: If the list is in multi-line format — e.g., name/address labels — with each item in the list separated with two hard returns (or a hard page break [HPg]), then use the Sort by Paragraph radio button.]

5.
Under "Keys (sorting rules)":

•  For Line sorts: For Key 1, "Field": enter "1" (without quotes); for "Word": enter "-1" (i.e., minus 1, without quotes).

•  For Paragraph sorts: For Key 1, "Line": enter "1" (without quotes); "Field": enter "1" (without quotes); for "Word": enter "-1" (without quotes).

•  For "Sort order" you should choose Ascending if you want the sort to be a..z.

•  If you are sorting on ZIP codes, see the Tip above.

•  If you are sorting people's names and you also want to sort duplicate surnames alphabetically by the person's first name, add another key (Key 2) with a "1" (without quotes) in the Line, Field, and Word fields (assuming the first name is the first word on each line).

6.
Click OK to dismiss the New Sort dialog and return to the Sort dialog.

7.
You may want to click the Options button to "Allow Undo after sorting" and/or "Uppercase sorts before lower case". Most users will accept all other defaults in that dialog, but feel free to modify them.

8.
Click Sort.


... Other ways to sort (macros and tables):

EXAMPLE 4: Macro example to do a Line sort on first..ninth words on each item


Here is a small macro that does an ascending Line sort with nine (9) sort keys (upper case sorts first, but you could change to LowercaseFirst! in the macro's SortCaseOrder command).

This "multiple key" method should produce more accurate Line sorting in lists where there are possible first (and second, etc.) word duplicates. It works on a selection of lines, too. See (e.g.) the examples used in some simple tests in a post on WordPerfect Universe here.

(For sorting WordPerfect tables, see the next example below.)

Tip: You could, of course, manually create a custom sort such as those above, by adding additional Keys with incrementing "Word" values for each Key.

Note: Using this macro routine I recently discovered that sorting very long lists (or possibly long lists with some long items) can cause the routine to fail and possibly cause WordPerfect to freeze. My solution for that document was to use just one sort key, not nine keys. (See Footnote 1 below for a possible workaround in very long lists. Note also I did not test other variations, such as eight keys, seven keys, etc., nor did I try varying the length of the list to be sorted. Hence, this notation is merely an an anecdotal observation and may not affect you.)

[To copy this code into your WordPerfect program to create a working macro, see here. You can then assign the macro to a toolbar or keyboard shortcut; see here for how to do it.)]

// Sort on up to 9 words per line ("Line sort"):
SortKeys (
{1; 1; 1; Alphanumeric!; Ascending!};
{1; 1; 2; Alphanumeric!; Ascending!};
{1; 1; 3; Alphanumeric!; Ascending!};
{1; 1; 4; Alphanumeric!; Ascending!};
{1; 1; 5; Alphanumeric!; Ascending!};
{1; 1; 6; Alphanumeric!; Ascending!};
{1; 1; 7; Alphanumeric!; Ascending!};
{1; 1; 8; Alphanumeric!; Ascending!};
{1; 1; 9; Alphanumeric!; Ascending!})
SortType (LineSort!)
SortUndo (Undo!)
SortCaseOrder (UppercaseFirst!)
SortSelectString ("") // (i.e., null, or empty)
Sort
Return
// End of macro

Note

This macro does not create a new rule in the Sort dialog. It's a one-off operation performed by the macro each time you play it.


EXAMPLE 5: Sorting a table

[See also the examples on using a table as a tool below.]

•  It is a good idea to save the document before performing any sort on it. You can also enable "Allow Undo" in the Tools, Sort, Options button drop list.

•  The individual items in a sort are considered to be "records." WordPerfect lets you sort five kinds of records:

▸ lines (each ends with one hard return),
paragraphs (each ends with multiple hard returns),
merge records,
parallel columns (table column or parallel column), and
the rows in a table.

•  Each row of a table is a record, and it is divided into its parts:

Column (cell), Line (text in a cell), and Word (text in a cell).

Cells are numbered from left to right, starting with cell 1.


•  WordPerfect ships with several types of sort, as shown in the "Sort by" field. Select the one that applies to your text.

Note the Options button might have value to your current sort: "Allow Undo after sorting" and Uppercase sorts before lower case (default: Lower case sorts before upper case).

•  To define a custom table sort:

Place your cursor in the table, click Tools, Sort, New.

Give the sort a name (e.g., "My New Sort").

Then with the Table Row radio button enabled, define the "Sort by" rule (or key), which defines the order in which the sort will be conducted.


Tip:

You can define additional rules with the Add Key button.


For example, if the first key sorts on the First cell in a table row, it will sort on the first word in that cell — i.e., Column 1 (i.e., first cell), Line 1 (current row), Word 1 (first word in the cell). You can add another key to also sort on the second word if the first word is the same as the first word in other cells in that column (e.g., "Accounting"). Similarly you can add a third key to sort on the third word. (Thus, "Accounting Department, Payables" would come before "Accounting Department, Receivables".)

WordPerfect allows using up to nine sort rules or "keys" to be used in a sort. Just add more keys (up to 9 maximum) with the same specification (i.e., Column 1, Line 1) but with a new Word number fro each key (2-9).

Note that very large tables or tables with large amounts of text in them might cause the sort to fail when using so many keys, possibly causing WordPerfect to freeze. (This is merely based on just a few anecdotal reports. Hence, always make a backup of the document first.)

•  Sorting a table with a macro that defines and uses all nine keys in a single sort rule:

Here's a macro snippet (similar to the line sort in Example 4 above) that uses all nine keys to sort a table (or a selection of table rows)
[1] alphanumerically in ascending order, and
[2] lower case first, and
[3] allowing you to Undo the result with Ctrl+Z.

[To copy this code into your WordPerfect program to create a working macro, see here.]

// Sort on up to 9 words in the first cell of each row ("Table sort"):
SortKeys (
{1; 1; 1; Alphanumeric!; Ascending!};
{1; 1; 2; Alphanumeric!; Ascending!};
{1; 1; 3; Alphanumeric!; Ascending!};
{1; 1; 4; Alphanumeric!; Ascending!};
{1; 1; 5; Alphanumeric!; Ascending!};
{1; 1; 6; Alphanumeric!; Ascending!};
{1; 1; 7; Alphanumeric!; Ascending!};
{1; 1; 8; Alphanumeric!; Ascending!};
{1; 1; 9; Alphanumeric!; Ascending!})
SortType (TableSort!)
SortAction (Sort!)
SortUndo (Undo!)
SortCaseOrder (LowercaseFirst!)
SortSelectString ("") // (i.e., null, or empty)
Sort
Return
// End of macro

Note

This macro does not create a new rule in the Sort dialog. It's a one-off  operation performed by the macro each time you play it.


•  As mentioned, normally lowercase sorts before uppercase. To reverse this, click the Options button and choose "Uppercase sorts before lowercase." (In the above macro change the command to SortCaseOrder (UppercaseFirst!).)

•  To sort by the last word in a particular column's cells, specify the column number to use and then use "-1" (without quotes) in the Word field, "-2" for the next to last word, etc.

•  Sorting ordinary text lines with a macro: The same basic macro snippet above could be used to (e.g.) sort ordinary lines of text not inside a table, such as in a list of terms with each on its own line: Just change the SortType(...) parameter from TableSort! to LineSort!.

Notes and tips:

¤  WordPerfect format codes ([Tab], [Hd Left Ind], etc.) are treated as field separators by the sort feature. Hence it might be a good idea to look over the table in the document and see if all rows used in the sort have the same "format" (i.e., same number and location of Tabs, etc.) if you wish to use a particular field to sort on.

¤  On the other hand, spaces, forward slashes (/), and hyphens separate words.

¤  Dates can be used as a Key Type (WordPerfect 10+), and each date in the table should be separated by slashes or hyphens; all characters are considered when sorting dates in numerical order. Hence, use the same format for all dates (e.g., 10 characters: 09/25/2013). Also: As noted, the slash or hyphen can be used to separate words, so parts of dates (e.g., the year) can be used as "words" to define a sort key for the dates you want to sort. See WordPerfect's Help <F1> or the Reference Center (on the Help menu) for more information.
EXAMPLE 6: Table as a tool: Sorting on the second column of a table

[Note that this example uses the second column to sort the table ... but any column can be used to sort the table. See below for more examples on using a table as a tool.]

Here's how to convert a "line item" list into a table to sort it by a specific column (e.g., the second column), then restoring the data to a list format.

Assuming there are just single spaces between the words in every item in the list (if not, you can use the DeSpacer macro to remove extra spaces)

and -

assuming the list is composed of items that end in single hard returns (i.e., the list is not a series of paragraphs)

then -

1. Select the entire list and then click on Table, Create. Enable the User Defined radio button in that dialog, and enter a single space in the small field to the right of that choice. (Press the spacebar once in that field.) Click OK.

This turns the list into a table with each word in a separate cell. Examine the first two columns; if any of them are empty cells, then the sorting results will not be correct. (You can Undo things with Edit, Undo or Ctrl+Z and make corrections to the list.)

2. Next, create a new sort Key (or edit an existing key), such as "Second cell in a table row," and change the "Column" field to "2" (without quotes). [If you need help, see the regular sort feature methods above about creating a custom sort Key.]

3. Sort the table. Put your cursor in the table and use Tools, Sort, and choose the sort Key (e.g., "Second cell in a table row.") (You can click the Options button to "Allow Undo after sorting".) Then click Sort.

The list, in Table form, should now be sorted on items in the second column (the "second word in the list").

5. Convert the table back into your original list format this way:

(a) Delete the [Tbl Def] code in Reveal Codes: Put the cursor to the left of that code and press the <Delete> key. The Delete Table dialog should appear.

(b) In the Delete Table dialog, choose "Convert table contents." Click OK, then choose "Convert tables to text...Separate text with other." Enter a single space in the small field to the right of that choice. (Click in that field and press the spacebar once.)

(c) Click OK.

Done! [N.B.: Tested in WPX5 but the process should be the same or similar in other versions.]


EXAMPLE 7: Table as a tool: Using a table to sort regular paragraphs in reverse order

If you are keeping a diary, journal, or other document where you enter new lines (or paragraphs) at the end of the document, but now want to reverse the order of the items so that the most recent are at the top, here's a good way to do it.

Note: Using a table also helps prevent changes to existing formatting in the paragraphs (such as existing automatic numbering scheme applied to the paragraphs). The table cells act like little protective containers for each of your paragraphs during the sort.

Tips: If the paragraphs are separated by more than one hard return code (i.e., displayed as [HRt] in Reveal Codes) and you want to remove the extra ones first ... this can be done with Edit, Find and Replace to replace the multiple adjacent codes with a single code. (For more on this see the Find and Replace tips here.) Removing extra hard returns is not required for the procedure below,and in fact might not always be desirable. You might actually want the extra space (which to the program in this case is an extra — if empty — paragraph). Work on a copy of your document and try it both ways, with the extra returns and without them.

1. Select all paragraphs in the document with your mouse or keyboard, or with Edit, Select, All (or Ctrl+A on the Windows keyboard).

2. Click Table, Create and set the Columns = 1 and Text Delimiters = Paragraphs. Click OK. You should now have a table with all document paragraphs in separate cells.

3. With the cursor in the table, click Table, Insert, Columns = 1, Before, OK. You should now have a two-column table with the first column being empty. (At this point don't worry about column widths since you will be removing this column later.)

4. Enter a 1 in the top cell of the first column, and a 2 in the cell just below it in the same column. Select just the entire first column (either "paint" all cells in that column, or place the cursor just under the top edge of the first cell in the column; when it changes to an up arrow you can double click there to select the entire column).

Then click Table, QwickFill. This should sequentially number all cells in the first column. Click in the second column (or outside the table) to deselect the first column.

5. Sort the table: With the cursor in the table, click Tools, Sort to bring up the Sort dialog.

Choose "First cell in a table row," then click New. Give the new sort routine a name (e.g., "Reverse table sort"). The "Sort by" radio buttons should be set to "Table row."

Then, under "Keys," set the Type = Numeric and Sort Order = Descending.

Click OK.

With the new routine name ("Reverse table sort") selected in the Sort dialog, click Sort. The entire table should immediately sort into reverse order.

6. Place the cursor in the first (numbered) column. Click Table, Delete, Columns, 1, OK. You should now have a one-column table again. (The width of the column can be ignored here.)

7. Final steps: With the cursor in the table, click Table, Convert. Select the "Convert tables to text" button, and the "Separate text with paragraphs (hard returns)." Click OK.

EXAMPLE 8: Table as a tool: Using a table to randomize a list of items - or even a block of sentences or paragraphs

See the Using WordPerfect tables page here.


Footnote 1

[...Continued from above...]

In very long lists, multiple key used for Line sorting might cause some systems to freeze, possibly due to limited computer memory.

One workaround might be to use just a one key sort on such lengthy material that has been temporarily modified to create lines consisting of single "words" (i.e., no space characters) instead of multiple words per line (i.e., words separated by space characters).

The idea is to temporarily replace all existing space characters in the material to be sorted with another character or symbol (Ctrl+W) not otherwise used in that material (e.g., the pipe character, "|"), The program's Find and Replace (using the Replace All option) can do this virtually instantaneously, and later restore the strings just as quickly.

The method:

[Important: This operation — tested using a very large number of lines (i.e., each ending with a single [HRt] code) using a Line sort — probably is best done when the chosen lines are first copied into a new document that can be used as a "workspace," then later copied back into the source document, replacing the original lines.]

Using Find and Replace (with Replace All):

1. Find (search) all sentence "enders" (period+space) to separate the Lorem Ipsum paragraphs containing multiple sentences into single sentences ("Lines").

Then replace the enders with single hard returns (period+[HRt]). Time taken: Instantaneous.

2. Remove any extra hard returns (i.e., [HRt][HRt]) so that all sentences were separated by single hard returns ([HRt]). Time: Instantaneous.

3. Replace all spaces (" ") with pipe characters ("|"). Time: Instantaneous.

Using Tools, Sort, "First word in line" (using a 1-key sort rule):

4. Sort the document with a 1-key sort rule, "First word in a line". (See examples above.) Time: Typically only a few seconds.

5. Replace all pipe characters ("|") with spaces (" ") to restore each line to their multiple word format. Time: A few seconds.

In testing, the results show that an alpha Line sort was successful with ~50,000 words contained in several hundred lines — even some lines that had 350 words that wrapped around to several lines (i.e., soft returns at the right margin). Of course, these items might exceed the (presumed) sort limit of 160 (or more) characters per "word" as noted in a thread on WordPerfect Universe.