LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Returning filenames numerically

Solved!
Go to solution

Hi All,

 

I have a large number of files that I need to pull the data from and stitch it together, I have an idea of how I can do this but the "List Folder.vi" that I was intending to use returns the filenames alphabetically giving me an array of file names in the following format:

 

1-xxxx, 10-xxx, 100-xxx, 2-xxxx, 20-xxx and so on.

 

I can't quite get my head around how I can re-sort the array so that irrelevent of the number of files in the  folder I always get the array in numerical order.

 

Any help?!

 

Cheers,

 

Dom

0 Kudos
Message 1 of 5
(2,770 Views)
Solution
Accepted by topic author DominicRoberton

Hi Dom,

something like shown in the attached image should work for you.

 

Mike

Message 2 of 5
(2,767 Views)

Cheers for that,

 

I am not going to lie though the input string you used looks basically a bit like magic to me!!!  Can you show me how I would modify it to take care of files using the following naming system:

 

1-ER-Data

1-SS-Data

1-SS-GPSData

1-SS-UTCTime

 

Many thanks.

 

Dom

0 Kudos
Message 3 of 5
(2,757 Views)

Actually I should have just tried what you put up before asking!!!

 

Thanks, it works 🙂

 

Any chance you can explain to me how it works?  Particularly why you input the magical numbers text string you did!!!

 

Cheers,

 

Dom

0 Kudos
Message 4 of 5
(2,751 Views)

Hi Dom,

the "magic" string cuts the filename into extension and name without extension.

 

Mike

0 Kudos
Message 5 of 5
(2,748 Views)