Read the numeric value out of the string as a number, create an array of
clusters of "number, filename". Sort the array (clusters are sorted by
sorting the first element first, and if there's a match, breaking the tie
based on comparing second element, then third element, etc). After sorting,
pull the filenames out of the array.
Pojundery,
Stephen R. Mercer
-= LabVIEW R&D =-
|---------+---------------------------->
| | Kalyanramu |
| | Vemishetty |
| | <[EMAIL PROTECTED]>|
| | Sent by: |
| | <[EMAIL PROTECTED]|
| | a.army.mil> |
| | |
| | |
| | 03/11/2004 11:05 |
| | AM |
|---------+---------------------------->
>------------------------------------------------------------------------------------------------------------------------------|
|
|
| To: [EMAIL PROTECTED]
|
| cc:
|
| Subject: Sorting 1d array of alphanumeric strings
|
>------------------------------------------------------------------------------------------------------------------------------|
Hi all,
I am working on an application which involves sorting of filenames.
The problem I am facing is that,
If I have filenames such as
data1.dat
data3.dat
data11.dat
data2.dat
data12.dat
Then using the sorting of sortings, I get
data1.dat, data11.dat,data12.dat,data2.dat,data3.dat.
But the result I want is
data1.dat,data2.dat,data3.dat,data11.dat,data12.dat.
I undertand why I get the result(because we are comparing strings.
But inorder to get the result as I want what should I do.
What would be the quickfix for this problem in LabVIEW.
Any help would be appreciated.
Thanks,
Kalyan