If you can choose your filenames ahead of time, name them data001.dat,
data002.dat, etc.

You could also do string manipulations to strip out the prefix ("data") and
convert the string's numerical portion to integer. Sort the prefix array
based on the integer array and re-attach the prefix. This is easiest if the
filenames follow a predictable naming convention. :)   

Johann.

-----Original Message-----
From: Kalyanramu Vemishetty [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 11, 2004 12:05
To: [EMAIL PROTECTED]
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


Reply via email to