• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Sorting a List of Lists
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sorting a List of Lists


  • Subject: Sorting a List of Lists
  • From: Marconi <email@hidden>
  • Date: Sat, 27 Apr 2013 14:49:31 -0700

I have a list of lists with two items in each list.

{"2013-04-01", "some text here"}
{"2010-07-11", "some other text here"}
{"2012-12-22", "some different here"}

and so on. That is, my list of lists might be:

{{"2013-04-01", "some text here"},{"2012-07-11", "some other text here"},{"2010-12-22", "some different here"}}

Most of these lists of lists will be in the range of 100-200 item pairs in each list.

I need to sort these on the first datum so that the above list would come out:

{"2010-07-11", "some other text here"}
{"2012-12-22", "some different here"}
{"2013-04-01", "some text here"}

I tried a generic bubble sort but get the error:

Can't make {"2013-04-01", "some text here"} into type number, date or text.

Treating "2013-04-01" as ASCII would be fine with me, though I suspect it's treating the dates as type number.

What to do?







 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Sorting a List of Lists
      • From: Deivy Petrescu <email@hidden>
    • Re: Sorting a List of Lists
      • From: Christopher Stone <email@hidden>
    • Re: Sorting a List of Lists
      • From: Barry Wainwright <email@hidden>
  • Prev by Date: Re: Epoch Seconds to YYYY-MM-DD
  • Next by Date: Re: Sorting a List of Lists
  • Previous by thread: Re: Epoch Seconds to YYYY-MM-DD
  • Next by thread: Re: Sorting a List of Lists
  • Index(es):
    • Date
    • Thread