LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

looping through data files in a folder

Solved!
Go to solution

Hi, 

 

I need to look at several files of data. How can I loop through all the files in a directory in order to get the data from those files? 

 

 

Thanks very much

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

Build an array of the file names in the folder you are interested in, using the Advanced File Functions "List Folder" under File I/O, then index through the file names (a while loop possibly) where each file name will be used to perform whatever function(s) you are trying to perform.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



Message 2 of 5
(5,815 Views)
Solution
Accepted by topic author CRivett

An autoindexed FOR loop would be the way to go.  As already stated, use the List Folder function to get a list of the files in the folder.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 5
(5,782 Views)

Thanks a bunch! Both posts were very helpful!

0 Kudos
Message 4 of 5
(5,777 Views)

@CRivett wrote:

I need to look at several files of data. How can I loop through all the files in a directory in order to get the data from those files?


You can use either

a. List Folder Function OR

b. Recursive File List VI

 

Later is useful if you have nested folders containing data files, so you can input the top level directory and this VI will output all files in that folder or any sub-fiolder.


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


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