LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2D array array to alphabetical order

Solved!
Go to solution

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 🙂

0 Kudos
Message 1 of 10
(6,017 Views)

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

 

 

0 Kudos
Message 2 of 10
(6,005 Views)

Hi AliasA,

  Can you  explain a little more clear about your problem?

 

 

Thanks and regards,

srikrishnaNF

Regards,
Srikrishna


0 Kudos
Message 3 of 10
(6,002 Views)

srikrishnaNF wrote:

Hi AliasA,

  Can you  explain a little more clear about your problem?

 

 

Thanks and regards,

srikrishnaNF


Hi, attached picture tells about what i am trying to do...

 

0 Kudos
Message 4 of 10
(5,987 Views)
Solution
Accepted by Alias A

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

Message Edited by MarcoMauri on 06-07-2010 03:30 AM
Message 5 of 10
(5,978 Views)

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...

Message Edited by GerdW on 06-07-2010 11:22 AM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 10
(5,948 Views)

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
Greets, Dave
Message 7 of 10
(5,932 Views)

@ AliasA: KUDOS are FREE! :smileywink:

Message Edited by MarcoMauri on 06-07-2010 05:19 AM
0 Kudos
Message 8 of 10
(5,917 Views)

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-

0 Kudos
Message 9 of 10
(5,892 Views)
Message 10 of 10
(5,880 Views)