LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

list files from a folder

Maybe this will be helpful.

0 Kudos
Message 11 of 18
(605 Views)

@Bob_Schor wrote:

This reminds me of a colleague who embedded Time Stamp information into the filename.  What a mess!  Dec 2025 sorts before Jan 2008!


ISO 8601 - Wikipedia

 

I like the short format of 240926 for todays date, sorts well in a file listing. 🙂

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 12 of 18
(600 Views)

Hi Paul,

 


@paul_a_cardinale wrote:
For sortable dates with good readability, I use this format 2025-09nov-01.

So 2025-01aug will be sorted before 2025-01jan?

And 2025-01dec will be sorted in which position of your list?

2025-01aug
2025-01dec
2025-01jan
2025-01mar

 

(I'm a HUGE fan of ISO8601…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 13 of 18
(597 Views)

@GerdW wrote:

Hi Paul,

 


@paul_a_cardinale wrote:
For sortable dates with good readability, I use this format 2025-09nov-01.

So 2025-01aug will be sorted before 2025-01jan?

And 2025-01dec will be sorted in which position of your list?

2025-01aug
2025-01dec
2025-01jan
2025-01mar

 

(I'm a HUGE fan of ISO8601…)


My example was incorrect.  The format I use is yyyy-mmnnn-dd.  Which would be something like 2025-09sep-01.

I also am a big fan of ISO8601, But sometimes, for extra readability, I append the month abbreviation to the month number.

0 Kudos
Message 14 of 18
(582 Views)

Thanks for the link to the sorting library. This did the job.

Girish

0 Kudos
Message 15 of 18
(498 Views)

Hi, Girish.  You did a great service by trying various methods to get the file list in the order you want.  Now, please go back to this thread and "Mark as Solution" the one that describes "what works for you".  [I'm not sure which of several similar "variations on a theme" you decided to adopt, but if we've helped you by suggesting "thinks to try", help us and other future readers of this thread by indicating "which one worked best" for you.]

 

Bob Schor

0 Kudos
Message 16 of 18
(476 Views)

For fun, I implemented a quick idea that will consider all numerical "fields" (20 consecutive numeric digits or less) are considered are treated as numeric for the sorting logic.

 

Probably needs a few tweaks, but seems more universal than code found elsewhere here.

 

altenbach_0-1728142605622.png

Yes, the "scan-format" operation could be avoided but this is more readable)

0 Kudos
Message 17 of 18
(419 Views)

I like the concept.

Here's my hack at it.

ASpac.png

0 Kudos
Message 18 of 18
(406 Views)