text sortType

Andrew Kluthe andrew at ctech.me
Tue May 28 15:09:59 EDT 2013


That would handle it for the most part, jaque, but some of the data has
multiple words in the first item.

Here is a real sample of the most intricate of the data I would be sorting
in that first item.

MA West Creek 14

This would be a string to designate a field code we use. the first two are
an abbreviated version of the county the farm is located in, the second is
the common name of the farm and the last is a code for the specific chunk
of land we are talking about.

Sorting by words would work if the second piece of data in that string
wasn't multiple words sometimes and I had some way to know how many words
were in that item.

I am thinking the string is just too variable to sort it down in that way
without replacing spaces with another character momentarily.

Thanks for the help.


On Tue, May 28, 2013 at 1:58 PM, J. Landman Gay <jacque at hyperactivesw.com>wrote:

> On 5/28/13 1:46 PM, Andrew Kluthe wrote:
>
>> Ah, I should have been more clear in my example.
>>
>> Item 1 is a string consisting of a name and a number with a space in
>> between. The other items I have not provided examples of here, because
>> they
>> contain information unrelated to the sort  but may have made what I am
>> trying to do more clear.
>>
>> If i sort by item 1 I would assume that "MO 8" would be placed before "MO
>> 12" but it stops when it comes to the number.
>>
>> I beleive this is because the "1" in "12" in the example above comes
>> before
>> "8". I wish it would consider "12" an entire number in the match, but I
>> understand why it doesn't work this way because it is using ASCII numbers
>> to sort them yes?
>>
>> I always get in the habit of setting the itemDelimiter right before a
>> sort,
>> so i don't think it's getting changed.
>>
>
> Does this do it?:
>
> sort lines of fld 1 numeric by word 2 of each
> sort lines of fld 1 by word 1 of each
>
>
>
>  On Tue, May 28, 2013 at 1:22 PM, <dunbarx at aol.com> wrote:
>>
>>  There is an undocumented feature, though it is noted in the user notes
>>> under "sort" and "sort container" in the dictionary:
>>>
>>>
>>> sort by sortKey1 & sortKey2 & sortKey3...
>>>
>>>
>>>
>>> all in one line. Both methods produce stable multiple sorts.
>>>
>>>
>>>
>>> Craig Newman
>>>
>>>
>>>
>>>
>>> -----Original Message-----
>>> From: Tiemo Hollmann TB <toolbook at kestner.de>
>>> To: 'How to use LiveCode' <use-livecode at lists.runrev.com**>
>>> Sent: Tue, May 28, 2013 1:35 pm
>>> Subject: AW: text sortType
>>>
>>>
>>> How about sorting twice
>>> sort lines of sReportText numeric by item 2 of each
>>> sort lines of sReportText by item 1 of each
>>> didn't tested
>>> Tiemo
>>>
>>>
>>>  -----Ursprüngliche Nachricht-----
>>>> Von: use-livecode [mailto:use-livecode-bounces@**lists.runrev.com<use-livecode-bounces at lists.runrev.com>]
>>>> Im
>>>>
>>> Auftrag
>>>
>>>> von Andrew Kluthe
>>>> Gesendet: Dienstag, 28. Mai 2013 19:06
>>>> An: How to use LiveCode
>>>> Betreff: text sortType
>>>>
>>>> Hello Ya'll,
>>>>
>>>> I am trying to sort some tab delimited data by item 1 of each. Item 1 of
>>>> each is a name and a number.
>>>>
>>>> Kansas 1
>>>> Kansas 3
>>>> MO 3
>>>> MO 8
>>>>
>>>>
>>>> Anyhow, when I run the sort as
>>>>
>>>> sort lines of sReportText by item 1 of each
>>>>
>>>> I get it sorted pretty close, but entries with the same name and a
>>>> different number are not sorted numerically after being sorted
>>>> alphabetically.
>>>>
>>>> Are there any built in options or tricks I could use to get the desired
>>>> result without having to write a custom sort function for this seemingly
>>>> simple task?
>>>>
>>>>
>>>>
>>>> --
>>>> Regards,
>>>>
>>>> Andrew Kluthe
>>>> andrew at ctech.me
>>>> ______________________________**_________________
>>>> use-livecode mailing list
>>>> use-livecode at lists.runrev.com
>>>> Please visit this url to subscribe, unsubscribe and manage your
>>>> subscription preferences:
>>>> http://lists.runrev.com/**mailman/listinfo/use-livecode<http://lists.runrev.com/mailman/listinfo/use-livecode>
>>>>
>>>
>>>
>>> ______________________________**_________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription
>>> preferences:
>>> http://lists.runrev.com/**mailman/listinfo/use-livecode<http://lists.runrev.com/mailman/listinfo/use-livecode>
>>>
>>>
>>> ______________________________**_________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/**mailman/listinfo/use-livecode<http://lists.runrev.com/mailman/listinfo/use-livecode>
>>>
>>>
>>
>>
>>
>
> --
> Jacqueline Landman Gay         |     jacque at hyperactivesw.com
> HyperActive Software           |     http://www.hyperactivesw.com
>
>
>
> ______________________________**_________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/**mailman/listinfo/use-livecode<http://lists.runrev.com/mailman/listinfo/use-livecode>
>



-- 
Regards,

Andrew Kluthe
andrew at ctech.me



More information about the use-livecode mailing list