Natural Sorting in Microsoft Word
April 9, 2012 7:36 PM
How do I sort paragraphs naturally in Microsoft Word 2007 for Windows?
I have a list of citations in a Word document that look like this:
I, 1916 - 1917, 373 - 374, etc etc
I, 1916 - 1917, 315 - 325 etc etc
I, 1916 - 1917, 348 - 355 etc etc
I, 1916 - 1917, 33 - 36 etc etc
I, 1916 - 1917, 36 - 38 etc etc
When I go to sort them in Word, I get this:
I, 1916 - 1917, 315 - 325 etc etc
I, 1916 - 1917, 33 - 36 etc etc
I, 1916 - 1917, 348 - 355 etc etc
I, 1916 - 1917, 36 - 38 etc etc
I, 1916 - 1917, 373 - 374, etc etc
This happens if I use sort by text or sort by number. I would like to have it sort like this:
I, 1916 - 1917, 33 - 36 etc etc
I, 1916 - 1917, 36 - 38 etc etc
I, 1916 - 1917, 315 - 325 etc etc
I, 1916 - 1917, 348 - 355 etc etc
I, 1916 - 1917, 373 - 374, etc etc
Thank you for your help!
I have a list of citations in a Word document that look like this:
I, 1916 - 1917, 373 - 374, etc etc
I, 1916 - 1917, 315 - 325 etc etc
I, 1916 - 1917, 348 - 355 etc etc
I, 1916 - 1917, 33 - 36 etc etc
I, 1916 - 1917, 36 - 38 etc etc
When I go to sort them in Word, I get this:
I, 1916 - 1917, 315 - 325 etc etc
I, 1916 - 1917, 33 - 36 etc etc
I, 1916 - 1917, 348 - 355 etc etc
I, 1916 - 1917, 36 - 38 etc etc
I, 1916 - 1917, 373 - 374, etc etc
This happens if I use sort by text or sort by number. I would like to have it sort like this:
I, 1916 - 1917, 33 - 36 etc etc
I, 1916 - 1917, 36 - 38 etc etc
I, 1916 - 1917, 315 - 325 etc etc
I, 1916 - 1917, 348 - 355 etc etc
I, 1916 - 1917, 373 - 374, etc etc
Thank you for your help!
Copy and past the text into excel, and use the import wizard to split it into columns (delimited by space, likely). Then you can sort it by whatever columns you want. Word's sorting on the whole line, and without delimiter information, it's perfectly natural for it to put 348 before 36; it doesn't know there's a number there.
posted by scruss at 8:13 PM on April 9, 2012
posted by scruss at 8:13 PM on April 9, 2012
Thanks scruss, although it's maddening that MS Word apparently can't do natural sorting like Windows Explorer.
Do you know of a way to get it back to something nice and not spreadsheet-looking (ie from Excel back to Word)?
posted by dhens at 8:26 PM on April 9, 2012
Do you know of a way to get it back to something nice and not spreadsheet-looking (ie from Excel back to Word)?
posted by dhens at 8:26 PM on April 9, 2012
Do you know of a way to get it back to something nice and not spreadsheet-looking (ie from Excel back to Word)?
In the next free column, put
=a1&b1&c1....
and so on until you have all the columns concatenated. Then just copy that column, paste into word, and then in word do 'convert table to text'.
posted by pompomtom at 8:50 PM on April 9, 2012
In the next free column, put
=a1&b1&c1....
and so on until you have all the columns concatenated. Then just copy that column, paste into word, and then in word do 'convert table to text'.
posted by pompomtom at 8:50 PM on April 9, 2012
Excel might've eaten the spaces as delimiters, so maybe try
=a1&" "&b1&" "&c1&" "....
Natural sorting works great when you know that the input space is limited. Filenames are easy to get right because they're short, and in Windows really are only comprised name+extension. One of the sort algorithms linked above says it has difficulty with decimal fraction fields. Once you start getting into locale specific issues (such as thousand separators and decimal points being other characters in other countries) things get hairy. Language-specific collation adds weird to the hair; for instance, in Welsh, 'll' is a separate character that sorts after 'l', and under certain circumstances 'ng' should be sorted as 'g'. Add Unicode to that, and you've basically got a problem that's not easily defined, let alone solved.
MS Word is doing something simple that might work for some users. It has to cater to the lowest common denominator.
posted by scruss at 7:48 AM on April 10, 2012
=a1&" "&b1&" "&c1&" "....
Natural sorting works great when you know that the input space is limited. Filenames are easy to get right because they're short, and in Windows really are only comprised name+extension. One of the sort algorithms linked above says it has difficulty with decimal fraction fields. Once you start getting into locale specific issues (such as thousand separators and decimal points being other characters in other countries) things get hairy. Language-specific collation adds weird to the hair; for instance, in Welsh, 'll' is a separate character that sorts after 'l', and under certain circumstances 'ng' should be sorted as 'g'. Add Unicode to that, and you've basically got a problem that's not easily defined, let alone solved.
MS Word is doing something simple that might work for some users. It has to cater to the lowest common denominator.
posted by scruss at 7:48 AM on April 10, 2012
This thread is closed to new comments.
posted by dhens at 7:38 PM on April 9, 2012