ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

list folder chronologically instead of alphabetically

Solved!
Go to solution

Hello,

 

I would like to sort file names of files that have been saved chronologically instead of alphabetically.

I used the "List Folder" function which sorts the file names alphabetically. But I would like to have the possibility to sort the file names chronologically, that means from the oldest to the most recent one.

 

Can anybody help me for that?

 

Thank you in advance.

0 Kudos
Message 1 of 8
(6,520 Views)

Hi Catty,

 

You can loop over the files and get each file's modification data using File/Directory Info. Then sort based on that.

 

Or you can use a system exec call (see attachment) and parse it's output.

 

Hope this helps,

Daniel

 

0 Kudos
Message 2 of 8
(6,511 Views)

Hi catty,

attached you will find another solution for you.

 

Mike

Message 3 of 8
(6,505 Views)

MikeS81 wrote:

Hi catty,

attached you will find another solution for you.

 

Mike


This is exactly what I meant in my first suggestion. Thanks for coding it 😉

 

Message 4 of 8
(6,501 Views)
Solution
Accepted by topic author Catty

Hello Daniel and Mike,

 

Thank you so much for your quick answer. You made me save a lot of time...

I used Mike's solution because I could not open Daniels one because I've got an older version of LabVIEW.

 

I really appreciate your help.

 

Have a nice day,

Catherine

0 Kudos
Message 5 of 8
(6,437 Views)

Hi Catherine,

the attached image shows Daniels example.

 

Mike

Message 6 of 8
(6,434 Views)

Thanks Mike.

I would also use Mike's implementation.

 

0 Kudos
Message 7 of 8
(6,416 Views)

Well, anyway, thanks to both of you for your time and your precious help! It works!

I started with LabVIEW a few month ago and it's not always easy to find rapidly a solution to what I want to do.

Thanks again, I won't hesitate to ask my future questions in this forum...

 

Best regards,

Catherine

0 Kudos
Message 8 of 8
(6,393 Views)