Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#362280 - 29/07/2014 21:23 MS-Word Sorting Weirdness
tanstaafl.
carpal tunnel

Registered: 08/07/1999
Posts: 5549
Loc: Ajijic, Mexico
Below is a list of hikes scheduled by my hiking club for August. I copied and pasted from the email into MS-Word 2010, to sort the list so that the Friday hikes came out grouped together, ascending by date.

Well, that's not what happened, and I can't figure out why.

First, here's the original list pasted from the email:

====================================================
Friday, August 1 Ixtlahuacan Loop

Tuesday, August 5 Salvaje Race Trail

Friday, August 8 Four Ridges (Traditional Route) Agave Ridge to Ceremonial Grounds)

Tuesday, August 12 Chupinaya Race Trail

Friday, August 15 Rubin's Milpa, Dancing Rock and Cuevas Indios (Exploration)

Tuesday , August 19 La Floresta > La Canada (Early Start)

Friday, August 22 Cierro Viejo Interpretive Trail

Tuesday , August 26 Goat Farm >Oak Forest > Ixtlahaucan

Friday, August 29 Chiquilistlan (Early Start)
===============================================================

Here's the list pasted from MS-Word before I sorted it. I made four slight formatting changes, getting rid of two typographical errors--the "space" before the comma on two of the "Tuesdays", which would have certainly caused sorting error, and changing two double-spaces to single spaces after the word "August".

===============================================================

Friday, August 1 Ixtlahuacan Loop

Tuesday, August 5 Salvaje Race Trail

Friday, August 8 Four Ridges (Traditional Route) Agave Ridge to Ceremonial Grounds)

Tuesday, August 12 Chupinaya Race Trail

Friday, August 15 Rubin's Milpa, Dancing Rock and Cuevas Indios (Exploration)

Tuesday, August 19 La Floresta > La Canada (Early Start)

Friday, August 22 Cierro Viejo Interpretive Trail

Tuesday, August 26 Goat Farm >Oak Forest > Ixtlahaucan

Friday, August 29 Chiquilistlan (Early Start)

===========================================================
Now, here's what the list looks like after sorting it. Sort by "Paragraphs" (there is a hard paragraph at the end of each line), type "Text", Ascending. Results are not as I anticipated.
===========================================================
Friday, August 29 Chiquilistlan (Early Start)
Friday, August 8 Four Ridges (Traditional Route) Agave Ridge to Ceremonial Grounds)
Friday, August 1 Ixtlahuacan Loop
Friday, August 15 Rubin's Milpa, Dancing Rock and Cuevas Indios (Exploration)
Friday, August 22 Cierro Viejo Interpretive Trail
Tuesday, August 19 La Floresta > La Canada (Early Start)
Tuesday, August 26 Goat Farm >Oak Forest > Ixtlahaucan
Tuesday, August 12 Chupinaya Race Trail
Tuesday, August 5 Salvaje Race Trail
==============================================================
Single spaced now, because all the empty paragraphs that gave the double spacing sorted to the top of the file. That was as expected. And all the Fridays sorted ahead of the Tuesdays, also as expected. But why didn't it sort the numbers following "August" in ascending order? Aha!, he said. Let's put leading zeroes ahead of the three single-digit numbers, that'll fix it.
==============================================================
Friday, August 08 Four Ridges (Traditional Route) Agave Ridge to Ceremonial Grounds)
Friday, August 29 Chiquilistlan (Early Start)
Friday, August 01 Ixtlahuacan Loop
Friday, August 15 Rubin's Milpa, Dancing Rock and Cuevas Indios (Exploration)
Friday, August 22 Cierro Viejo Interpretive Trail
Tuesday, August 19 La Floresta > La Canada (Early Start)
Tuesday, August 26 Goat Farm >Oak Forest > Ixtlahaucan
Tuesday, August 12 Chupinaya Race Trail
Tuesday, August 05 Salvaje Race Trail
===============================================================
Guess again. A couple of the Friday paragraphs changed position, but still not in ascending order by weekday, then by date. Aha!, he said. Let's try sorting it with a sort type of "Date" and see what happens. At least that will put it back into the order as seen in the original email.
==============================================================
Friday, August 08 Four Ridges (Traditional Route) Agave Ridge to Ceremonial Grounds)
Friday, August 29 Chiquilistlan (Early Start)
Tuesday, August 26 Goat Farm >Oak Forest > Ixtlahaucan
Tuesday, August 05 Salvaje Race Trail
Friday, August 01 Ixtlahuacan Loop
Tuesday, August 12 Chupinaya Race Trail
Friday, August 15 Rubin's Milpa, Dancing Rock and Cuevas Indios (Exploration)
Tuesday, August 19 La Floresta > La Canada (Early Start)
Friday, August 22 Cierro Viejo Interpretive Trail
==============================================================
Oh, yeah, that worked out real swell. Just one last thing to try. Let's sort it by "Fields" as the sort type. I'm guessing that the fields are comma-delimited, is that right? So I have two fields to play with: The "Friday/Tuesday" field, and the "August xx" field. That should give me exactly what I want. Shoulda tried it that way in the first place. First by field 1, then by field 2.
==============================================================
Friday, August 01 Ixtlahuacan Loop
Friday, August 15 Rubin's Milpa, Dancing Rock and Cuevas Indios (Exploration)
Friday, August 22 Cierro Viejo Interpretive Trail
Friday, August 08 Four Ridges (Traditional Route) Agave Ridge to Ceremonial Grounds)
Friday, August 29 Chiquilistlan (Early Start)
Tuesday, August 12 Chupinaya Race Trail
Tuesday, August 19 La Floresta > La Canada (Early Start)
Tuesday, August 05 Salvaje Race Trail
Tuesday, August 26 Goat Farm >Oak Forest > Ixtlahaucan
==============================================================
Well, not exactly what I was looking for. So, let's try reversing the field order -- sort by field 2, then field 1, That oughta do it!
=============================================================
Friday, August 08 Four Ridges (Traditional Route) Agave Ridge to Ceremonial Grounds)
Friday, August 29 Chiquilistlan (Early Start)
Tuesday, August 05 Salvaje Race Trail
Tuesday, August 26 Goat Farm >Oak Forest > Ixtlahaucan
Friday, August 01 Ixtlahuacan Loop
Tuesday, August 12 Chupinaya Race Trail
Friday, August 15 Rubin's Milpa, Dancing Rock and Cuevas Indios (Exploration)
Tuesday, August 19 La Floresta > La Canada (Early Start)
Friday, August 22 Cierro Viejo Interpretive Trail
===============================================================
Remember the big battle over whether the "Shuffle" feature in the empeg was truly random? Well, it looks like MS-Word can make a pretty good approximation of randomness with their Sort module. I've hit the limit of the options I can think of. I don't really care about the list, I can order it manually in a tiny fraction of the time I have spent trying to figure out what Microsoft is up to with their sort utility. But I want to know. Is it broken, or am I just not smart enough to figure out how to work it?

FWIW, these hikes we do are not sniff-the-flowers, look-at-the-birds nature hikes. We do them for the physical challenge, and they are indeed challenging. The attached photo is from a hike we did pretty much straight up the mountain from San Juan Cosala to the Sky Ridge Trail. Only two of us made it, because before the third person could cross "The Traverse" (it will always be referred to in bold italics, and nobody who tried it will ever willingly try it again) - anyway, before #3 could try it, one of the two dogs on the trip got a third of the way across, looked at the muddy footing on the 10 inch wide trail, the mud wall on the right, and the absolutely sheer 30 meter drop-off on the left, and sat down on the trail and would not move. The trail was too narrow to try and get past her, and we spent the better part of half an hour cajoling her with pleas, entreaties, threats, and dog biscuits, to no avail. Clearly she was the ONLY one of us with any intelligence. She was perfectly happy to retreat back to the beginning of "The Traverse", but no way would she cross it.

The picture is from a different part of the trail before "The Traverse" (that's me in the foreground), and was by no means the most difficult part of the hike. That hike lasted just under six hours, probably 1200 meters of elevation gain. Sometimes I think I'd have as much fun if I stayed home and beat on my toes with a hammer. But I gotta tell ya, even though I'll be 70 years old in a few months, I am in the best condition of my life what with the mountain biking, the kayaking, the gym workouts, and the hiking. I'm ten pounds lighter than I was in high school...

Life is good!

Now if I could just figure out how to sort a text file in MS-Word!

tanstaafl.


Attachments
SJC to Sky Ridge-W1500.jpg (61 downloads)

_________________________
"There Ain't No Such Thing As A Free Lunch"

Top
#362281 - 30/07/2014 09:57 Re: MS-Word Sorting Weirdness [Re: tanstaafl.]
Tim
veteran

Registered: 25/04/2000
Posts: 1525
Loc: Arizona
I can't help you with the MS Word sorting, but stuffing the text from the email into Excel and hitting the Sort A To Z spits out this:
Code:
Friday, August 1 Ixtlahuacan Loop
Friday, August 15 Rubin's Milpa, Dancing Rock and Cuevas Indios (Exploration)
Friday, August 22 Cierro Viejo Interpretive Trail
Friday, August 29 Chiquilistlan (Early Start)
Friday, August 8 Four Ridges (Traditional Route) Agave Ridge to Ceremonial Grounds)
Tuesday, August 12 Chupinaya Race Trail
Tuesday, August 19 La Floresta > La Canada (Early Start)
Tuesday, August 26 Goat Farm >Oak Forest > Ixtlahaucan
Tuesday, August 5 Salvaje Race Trail

Adding a 0 to the single date entries (August 8 becomes August 08) fixes the 8 is greater than 29 problem and spits out this:
Code:
Friday, August 01 Ixtlahuacan Loop
Friday, August 08 Four Ridges (Traditional Route) Agave Ridge to Ceremonial Grounds)
Friday, August 15 Rubin's Milpa, Dancing Rock and Cuevas Indios (Exploration)
Friday, August 22 Cierro Viejo Interpretive Trail
Friday, August 29 Chiquilistlan (Early Start)
Tuesday, August 05 Salvaje Race Trail
Tuesday, August 12 Chupinaya Race Trail
Tuesday, August 19 La Floresta > La Canada (Early Start)
Tuesday, August 26 Goat Farm >Oak Forest > Ixtlahaucan

I guess if that is what you want, you can always copy and paste back into Word... but then you would never know your answer laugh

Top
#362282 - 30/07/2014 10:44 Re: MS-Word Sorting Weirdness [Re: Tim]
tanstaafl.
carpal tunnel

Registered: 08/07/1999
Posts: 5549
Loc: Ajijic, Mexico
Originally Posted By: Tim
stuffing the text from the email into Excel and hitting the Sort A To Z spits out this:
Interesting that the sort works as expected in Excel, but not in Word.

tanstaafl.
_________________________
"There Ain't No Such Thing As A Free Lunch"

Top
#362283 - 30/07/2014 14:30 Re: MS-Word Sorting Weirdness [Re: tanstaafl.]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31597
Loc: Seattle, WA
The basic issue here is that Word has a bad default setting here, and you are assuming that Word should work correctly at the defaults. Come on, you expect them to, like, design this thing properly or something? smile

Sort By Paragraphs and Sort By Fields are wrong, and are poor defaults in situations where the thing you're sorting is just plain text. Following the steps you gave above, I would not have expected the sorts to work at all. In order to make it work, you have to do something else, something extra, something you didn't say you did, and something that is non-obvious in Word.

Because, according to the steps you gave, by default, Word did not have any fields to sort by. It didn't know what fields to use to sort. Instead, you have press the OPTIONS button in the sorting dialog and then tell Word what character you want to use as your column (field) delimiter.

Try this instead:

In the Sort Text dialog box, press OPTIONS.
Select SEPARATE FIELDS AT... OTHER
and in the "other" box type a space. Press OK.
Back in the main SORT TEXT dialog box, now your sorting options for your sorting columns are now available as things like "WORD 1" And "WORD 2". So now you can say Sort By Word 1, then by Word 2, then by Word 3 or whatever.

After correcting the dates to two digits with leading zeroes, then that sorts the way you would expect. For extra credit, have it sort by Word 2, then by Word 3, then by Word 4, then you get the correct date sorting without having to move the Tuesday and Friday columns.
_________________________
Tony Fabris

Top
#362284 - 30/07/2014 17:00 Re: MS-Word Sorting Weirdness [Re: tfabris]
tanstaafl.
carpal tunnel

Registered: 08/07/1999
Posts: 5549
Loc: Ajijic, Mexico
Originally Posted By: tfabris
After correcting the dates to two digits with leading zeroes, then that sorts the way you would expect.
Well... sorta. It still gave me semi-random sorts...until I sat down and re-typed the whole list. Then it sorted very nicely with your instructions. Were some hidden non-ascii characters embedded in the original paste from the email?

I could even sort the re-typed version correctly by Paragraph / Text (note that the goal of the whole operation was to have the Friday hikes listed separately from the Tuesday hikes) and sorting by Paragraph / Date also worked correctly with the re-typed list even without putting zeroes in front of the single-digits, inter-mixing Fridays and Tuesdays in chronological order.

So, with a correctly typed and formatted list to start with, the different sorts worked exactly as I had expected, and now all is right with the world. There was no need to change the options, or sort by fields, or change the field delimiter. I just had to give it valid data to sort.

Thank you, Tony.

tanstaafl.
_________________________
"There Ain't No Such Thing As A Free Lunch"

Top
#362285 - 30/07/2014 17:10 Re: MS-Word Sorting Weirdness [Re: tanstaafl.]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31597
Loc: Seattle, WA
It's certainly possible that there were nonprinting characters that got lost when the list was posted into this thread as an example. I copied and pasted from the BBS, so of course that's all I had to work with.

But I still couldn't even get the example list to sort correctly until I gave Word a proper field delimiter to chew on.

Note: You shouldn't need to retype from scratch to get rid of nonprinting characters or formatting. If I ever need to do something like that, I always paste into an ASCII text editor like UltraEdit, then copy and paste back again from it, to strip nonprinting characters or formatting information, from a piece of text.

Word also has an option, after you press Paste, to choose "Paste Text Only" instead of pasting everything including formatting and such. That often accomplishes the same goal.
_________________________
Tony Fabris

Top
#362286 - 30/07/2014 20:54 Re: MS-Word Sorting Weirdness [Re: tfabris]
Dignan
carpal tunnel

Registered: 08/03/2000
Posts: 12338
Loc: Sterling, VA
Originally Posted By: tfabris
Word also has an option, after you press Paste, to choose "Paste Text Only" instead of pasting everything including formatting and such. That often accomplishes the same goal.

That's the one I use. Most of my copy/paste stuff is done in Chrome, though, where they have the handy shortcut of Ctrl+Shift+V to handle that. I use it all the time.
_________________________
Matt

Top
#362291 - 31/07/2014 18:26 Re: MS-Word Sorting Weirdness [Re: Dignan]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31597
Loc: Seattle, WA
Also, most programs which allow you to paste "text only" can also configure it so that that's the default if you like. In the case of Word (and other apps in that suite such as Outlook), there are several options for pasting, depending on where you're pasting from.
_________________________
Tony Fabris

Top