Dear All,
I want to sort my array based on another array. Basically, I have an array of unsorted strings in no sequential order. I want to sort the array to my sorted array in sequence order. For example, my array is called to, the race go bob. I want to make it look like GO to the race bob. Does anyone have any solutions on how to tackle this problem.
Solved! Go to Solution.
I don't understand your task.
If you already have a sorted array, why aren't you just using that one?
If I understand your question correctly... then this is one of the tasks in LabVIEW that isn't the most elegant.
The simplest way I know to accomplish this is to just make an array of clusters and then sort that array... it will sort by the first element in the cluster.
I've attached an example.
@BowenM wrote:
If I understand your question correctly... then this is one of the tasks in LabVIEW that isn't the most elegant.
The simplest way I know to accomplish this is to just make an array of clusters and then sort that array. If you have an array of clusters and sort that array it will sort by the first item in that cluster.
I've attached an example.
Don't forget that if there is a tie, it goes to the next element in the cluster, and so on.
In LabVIEW 2018 Sort 2DArray was added in the array palette. Can sort by column or row and a specific index. No more making clusters needed..
mcduff