06-07-2010 02:57 AM
Hi,
I have huge 2D array where is thousands raws and every raw have 5 columns. Now I want to arrange that whole array to alphabetical order. First columns is arranger, where is string information, other columns are just numerical information.
Tips where i should start?
Thx 🙂
Solved! Go to Solution.
06-07-2010 03:11 AM
Hi!
how can it be that the first column contains strings and other columns contain numbers?
As far as I know this is not possible in Labview, so I suspect you have a 2D string array...
Anyhow, for sorting a 2D array using the value of the first colum
you can look here:
http://decibel.ni.com/content/docs/DOC-2122
http://zone.ni.com/devzone/cda/epd/p/id/2502
Marco
06-07-2010 03:13 AM
06-07-2010 03:24 AM
06-07-2010 03:30 AM - edited 06-07-2010 03:30 AM
1-Build a cluster with the string as the first element and an array of numbers as the second element.
2-Build an array of clusters from the elements of your tables
3-Sort the array of clusters
Marco
06-07-2010 04:20 AM - edited 06-07-2010 04:22 AM
Hi AliasA,
in addition to Marco's suggestion (which is suitable!), you shoul dnot forget to convert all the sorting strings to either lower or upper case. In your example you would get "chicken" after "Horse" as lower case letters are sorted behind upper case letters...
In general: array of clusters are sorted by the order of elements in the cluster. When the first element is equal for two clusters the 2nd element is used for sorting and so on...
06-07-2010 04:30 AM - edited 06-07-2010 04:31 AM
Hello all,
to clarify things said before, I attach a sample VI.
greets, Dave
06-07-2010 05:18 AM - edited 06-07-2010 05:19 AM
06-07-2010 06:13 AM
daveTW wrote:Hello all,
to clarify things said before, I attach a sample VI.
greets, Dave
Message Edited by daveTW on 06-07-2010 11:31 AM
Thanks guys... Another solution got from here 🙂
Dave can you please convert example to version 8.6
-Aa-
06-07-2010 06:30 AM