07-16-2009 11:14 AM
Greetings all. I've been beating my head against the wall on this and I think it is a "Forest for the trees" kind of thing. Anyway, I need to take a bunch of scanned in barcodes and then sort them based on the date code. The date code is the 4-digit number immediately following "FH-" I can pull the substring, make an array out of them and sort it no problem. But for the life of me I can't figure out how to then order the array of the original complete barcodes based on the datecode. Hope I am making myself clear. I attached a vi that shows the original barcodes, and how it should look after sorting. I need to be able to pull up a spec table based on the date code showing the oldest group. So, the date code in this example is 0808, 0902, 0806. I am running Labview 8.6 so nothing newer pls if an attachment is posted.
Appreciate any and all help/suggestions.
07-16-2009 11:38 AM
hello, Franco,
it can be done with your personal code but jki made good tools for that
have a look here
http://wiki.openg.org/Main_Page
Your vi modified in attachement
Best regards
Tinnitus
07-16-2009 01:27 PM
As long as your array isn't too big, you can use a loop and create an array of cluster with your first element as your extracted 4 digit code and the second element as your full scanned string.
Use the Sort 1D Array function on the array of cluster, then use a for loop to extract the scanned strings (now in order).
07-16-2009 04:04 PM
Here's yet another solution. Seems the codes are fixed width, so substring with start=14, size=4 might be easier that the scan operation shown.
05-23-2012 10:06 AM
Thanks for this posting! I needed a substring sort, found this, and I'm set! I'll credit you in my vi documentation.