Friday, December 07, 2007

When is Sorted Not Sorted?

Recently used BBedit to grep out good addresses from a mixed list of addresses using "Tools->Process Lines Containing..." with Grep expression.

Then used the Calmail web form to upload the list.

Used Calmail web form to show the list.

Copied the list from Mailman web page, pasted into a new BBedit file and compared it to my source file using bash diff. Big problem - many many differences that look the same to me!

Noticed that Mailman had converted all the emails to lower case. Used BBedit "Text->Change Case..." to do the same to my source list. Ran bash diff again. Still many many differences that look like....sort-order differences!

Ran sort on both files.

Now the problem is that 179 addresses apparently failed to upload!

Running sort -u finally cleared up all differences. Mailman silently de-duped the source list.

Moral of the story: assume that different apps (BBedit, Mailman, sort) will use different sort algorithms with different resulting sort orders.

2nd moral: I would have saved time and aggravation by doing all my editing in one environment.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home