Skip to content

Sorting paragraphs using Word - Part 2

In the second part of her “Sorting paragraphs using Word” article, Kara Monroe looks at delimiters and sorting options.

SORTING PARAGRAPHS AND MORE USING MICROSOFT WORD


By Kara Monroe

You are probably aware that Microsoft Excel can be used to put all of your data in order, but Microsoft Word has some pretty powerful sorting capabilities of its own, as long as you know how to enter the information into Word in a format that it can understand.

In this second part Kara Monroe looks at delimiters and sorting options. Click here to read the first part of this article.


WHAT’S A DELIMITER

To separate fields / columns, you will need to use a delimiter. ‘Delimiter’ is one of those geeky terms but all it means is what character separates one field / column from the next. What character you use depends on the software you are using and what data is in the fields.

You can’t have the delimited character also in the data – for example if you use the comma to separate fields you can’t have commas in the data too (because there’s no way for the software to tell the difference between the two). Therefore you need to choose your delimiter carefully.

For example consider these two address details.


Name, Address, City



  • Fred Dagg, 12 Clarke St, Auckland
  • Bruce Bayliss, Chez Bruce, John Rd, Taupo

The first line has three fields, separated by commas. But the second one has a comma in the Address and would look to a program like four fields. ‘John Rd’ would be considered the City and ‘Taupo’ ignored.

Thankfully using tables in Word or an Excel worksheet will save you worrying out old-fashioned delimiters. I’d suggest using tables wherever possible because it gives you maximum flexibility over time.

FIELDS OF DREAMS

The location of the Sort feature in the table menu indicates that, just as in Excel, you can sort by multiple columns of data at the same time (such as by name and then by date). However, you do not have to go to the trouble of putting data into a table to sort by multiple fields. However, you do need to enter data carefully in order to sort by fields without a table.

Word automatically recognizes tabs and commas as delimiters. When entering data, entering one delimiter will create a new field, regardless of whether or not you put data immediately after the delimiter or simply enter another delimiter. This isn’t a problem if you are using commas as your delimiters. If you’re using tabs though, we typically use tabs to line up data. If you use the default tab settings in word you may need two tabs to move from one column of data to the next in one line, but only one tab to move from one column of data to the next in the next line. You need to avoid “making things pretty” in order to make them sortable. If you truly must have your data lined up nicely, then you need to use the Format menu to create your own Tab stops before you enter your data to be sorted.

Let’s take a look at an example to see just how this field thing works. Enter the following list of movies, year they were released, and the name of the character Kevin Costner played in each. Each has been separated by a comma here, however you could substitute the comma with a tab if you wish.



  • Field of Dreams, 1989, Ray Kinsella
  • Bull Durham, 1988, Crash Davis
  • No Way Out, 1987, Tom Farrell
  • The Untouchables, 1987, Eliot Ness
  • Shadows Run Black, 1986, Jimmy Scott
  • Sizzle Beach U.S.A., 1986, John Logan
  • American Flyers, 1985, Marcus
  • Silverado, 1985, Jake
  • Fandango, 1985, Gardner Barnes

This list has three fields – the title of the movie, the year it was released, and the name of Costner’s character. Let’s say we want to sort the list by the name of each of Costner’s characters – that is the third field in our list. To sort the list, highlight it, select Table > Sort and then in the Sort by Box, select Field 3 and then click OK. The resulting list will look like this:



  • Bull Durham, 1988, Crash Davis
  • The Untouchables, 1987, Eliot Ness
  • Fandango, 1985, Gardner Barnes
  • Silverado, 1985, Jake
  • Shadows Run Black, 1986, Jimmy Scott
  • Sizzle Beach U.S.A., 1986, John Logan
  • American Flyers, 1985, Marcus
  • Field of Dreams, 1989, Ray Kinsella
  • No Way Out, 1987, Tom Farrell

You can also perform more advanced searches, sorting by more than one field. Let’s sort first by year produced, ascending rather than the descending order the list is currently in, and then by title. For that search, you’ll need to be sure that the Sort By box says Field 2 with type set to number and order set to ascending. Then By should be set to Field 1. The resulting list should be:



  • American Flyers, 1985, Marcus
  • Fandango, 1985, Gardner Barnes
  • Silverado, 1985, Jake
  • Shadows Run Black, 1986, Jimmy Scott
  • Sizzle Beach U.S.A., 1986, John Logan
  • No Way Out, 1987, Tom Farrell
  • The Untouchables, 1987, Eliot Ness
  • Bull Durham, 1988, Crash Davis
  • Field of Dreams, 1989, Ray Kinsella

 


DEALING WITH CASE

In general Microsoft Word will treat the words cat, Cat, CAT, and cAt all exactly the same. However, the Sort dialog box has an Options button that allows you to specify a case-sensitive sort. Let’s see what happens when we specify a case-sensitive sort using the versions of cat. The list



  • cat
  • Cat
  • CAT
  • cAt

will become:



  • cat
  • cAt
  • Cat
  • CAT

if you sort by paragraph and select the Options button and check the Case Sensitive checkbox.

HEADER OR NOT?

There’s nothing magical about the ‘no header row’ option in the sort command. All it does is tell Word whether or not to include the top row in the sort or not.

No Header Row – all rows will be sorted

Header Row – all except the top row will be sorted.


ONE FINAL OPTION

Under the options button in the sort dialog box there is one final option which is to “sort column only”. This option will not work unless you have your data in a table. If you’ve already spent a great deal of time entering all of your data using a tab or a comma delimiter as we’ve discussed here all is not lost. You can simply highlight your data and from the Table menu select Convert > Text to Table to put your data into a table. Then perform the sort, sorting only the column. You can even put your data right back into text format with delimiters using the Convert > Table to Text option. Be careful though, the sort by column only will disassociate your rows from one another so that, if using the data from above, it now appears that Kevin Costner played Crash Davis in Field of Dreams rather than in Bull Durham.

 

About this author