Re: how to sort a array?



roland.yan@xxxxxxxxx schreef:


"How to sort an array?" See `perldoc -f sort`.


I have a string array, for example @SampleArray, with the date and
time stamp included.

X2819460047100D,13/07/2006 23:50:39,OK,MC8775,R0-0-9,0.983,
X2819460016100D,13/07/2006 21:4:2,OK,MC8775,R0-0-9,0.672,
X2819460027100D,13/07/2006 23:52:39,OK,MC8775,R0-0-9,0.736,
X2819460072100D,13/07/2006 23:54:35,OK,MC8775,R0-0-9,0.825,
X2819460072100D,13/07/2006 23:56:37,OK,MC8775,R0-0-9,0.952,

You effectively want to isolate the first two of a group. For an
undisclosed reason you have decided that you want to use an array for
that.

You need to sort the data, on column 1+2, but your column 2 contains
strange time value representations, so you better fix those first.

--
Affijn, Ruud

"Gewoon is een tijger."


.



Relevant Pages

  • Re: "Sorting" assignment
    ... And many others prefer to call partition exchange because "quicksort" ... bin B depending on whether it is greater than, ... If the array is already sorted, this means that you end up ... attempt to sort them. ...
    (comp.programming)
  • Re: A Fast sorting algorithm for almost sorted data
    ... far my compressor has potential but is nowhere near ready. ... It does however make heavy use of sorting. ... which I am currently calling Run sort. ... entire selected run can be added to the sorted output array. ...
    (comp.compression)
  • A Fast sorting algorithm for almost sorted data
    ... which I am currently calling Run sort. ... entire selected run can be added to the sorted output array. ... public class RunSort implements Comparator ... public static void sort(Comparable a, int start,int end) ...
    (comp.compression)
  • Re: Save & Sort
    ... You can copy your array to a scratch ... "Heap" sort. ... Dim lst As Long ... Dim tmp As String ...
    (microsoft.public.excel.programming)
  • Re: fast stable sort
    ... if you have an existing array, you can simply arrange an array of ... pointers to the items, and sort that. ... hence require swapping pages of virtual memory, ... each merge run instead of accessing them in sequential RAM ...
    (comp.programming)