From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting files' names on LabVIEW

Solved!
Go to solution

Hi everyone,

 

I was wondering if there are any similar features on LabVIEW that does the job like "dir /b" command on windows cmd. This is to get the files name (in strings) in the directory that I refer it to.

In the end, I want to have a drop-down menu where I can read what files I have in my folder.

 

Has anyone every done something like this before?

 

Any answers would be very much appreciated! Thanks a lot!

 

Stephen

0 Kudos
Message 1 of 5
(5,427 Views)

Hey,

check on Blockdiagramm :

 

Programming -> File I/O -> Adv File Functions -> recursive file list.Vi

 

Regards,

CMW ...

0 Kudos
Message 2 of 5
(5,417 Views)
Solution
Accepted by topic author hariantos

You could use the List Folder Function to get all file/folder names in alphabetical order from a path to a directory:

 

Returns two arrays of strings listing the names of all files and folders found in path, filtering both arrays based upon pattern and filtering the filenames array based upon the specified datalog type.

 

 

EXAMPLE:  You can call it simply with the path and two indicators for files/folder names:

 

Untitled.png

 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If someone helped you out, please select their post as the solution and/or give them Kudos!
Message 3 of 5
(5,415 Views)
Solution
Accepted by topic author hariantos

Under File I/O -> Adv File Functions -> List Folder


This vi will display all filenames in a subdirectory.  I think this should get you going.

 

Hope that helps.


Adam

Message 4 of 5
(5,413 Views)

Thanks everyone for the super fast replies! It works just like I wanted it to.

 

Thanks again!

0 Kudos
Message 5 of 5
(5,386 Views)