LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I sort a string

Hi,
I want to sort a string (daycode), I use the daycode to sort my data. Now i want to sort the daycodes, but i do not know how.
Example: the daycode is a10r, so a is the first shift in week (b the second and so on), 10 is the week in year, r is the year.
Now i have a array with daycode-strings and want to sort it to year, week, shift (normaly it is sorted to the first letter).
Someone with a good idea???

Thanks a lot

Marco
0 Kudos
Message 1 of 7
(3,052 Views)
Try this vi and see if it is something you might be looking for and if not maybe you could explain a little more about what you want to do.



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 2 of 7
(3,044 Views)
Hi Marco

Try the attached example.

Good luck
Neil
0 Kudos
Message 3 of 7
(3,034 Views)
Joe

I tried the same technique, but I think the week digits become reversed and hence the sort is invalid.
😞
It would have been elegant had it worked. 😉

Neil
0 Kudos
Message 4 of 7
(3,030 Views)
Thanks for your fast answer,
I try it.
I write tables in ms access. So the tables are sorted by the first letter.
Example: a10r, b10r, d09r, k09r and so on. So I have 2 tables in week 09 and 2 tables in week 10.
But I want to sort it in LabView like this way: b10r, a10r, k09r, d09r, so that the newest one is the first in the array.
I think, I have to split the string in first letter (shift), than second and third (week), at least the forth (year).
Three steps to sort (year, week, shift), but i do not know how...

Thanks

Marco
0 Kudos
Message 5 of 7
(3,025 Views)
THAT´S IT

Thanks a lot and best regards

Marco
0 Kudos
Message 6 of 7
(3,019 Views)
Hi Marco

That can be done quite easily by reversing the array.
See attached.

Good luck
Neil
0 Kudos
Message 7 of 7
(3,018 Views)