LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Looking to Search and Sort String Twice, though am having issues

Having a bit of a problem with every column after the 2nd column.  For this particular sort each model contains 8 columns of particular data for that particular model (column 1).  Looking to keep this data attached to the model when doing the 2nd sort via the model #.

 

I've attached the sub-vi to give a better look at this.

 

Any thoughts?

0 Kudos
Message 11 of 15
(734 Views)

Looking at your SubVI I assume that the number of columns is fixed.  In that case, you could do something like this.

 

Sort2DStringArrayFixedSize.png

Message 12 of 15
(719 Views)

I must have had clusters on the brain, this is good for any number of columns.

 

Sort2DStringArrayFixedSize2.png

Message 13 of 15
(709 Views)

Very decent solution.  Thanks Darin.

 

How would you implement sorting for.... per say the 5th column or 3rd column?

0 Kudos
Message 14 of 15
(691 Views)

To sort on a different column I would typically build a cluster with that column and original index to produce a key which I then use to shuffle the array.

 

KeyedSortStringArray.png

 

To do more complex sorting I'd probably go green.

Message 15 of 15
(682 Views)