LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read all the files in the directory

Hi,

I want to read all the files from a directory and perform some operations on them. How to read one file at a time from the directory. Is there any operation like the * sign in Dos and Matlab. Is there any such vi which does that.

Thanks,

Nitin
Message 1 of 6
(3,456 Views)
You can just use the "List Directory" function in the File->Advanced File Functions palette to get an array of filenames and then do what you need.
Message 2 of 6
(3,450 Views)

And if you need a recursive list of the files/folders in a directory, you can use the Recursive File List.vi, found in vi.lib\utility\libraryn.llb.  This VI ships with LabVIEW 7.0 and later.

-D

Message 3 of 6
(3,440 Views)
Hi Darren, the VI you suggested indeed does the job and I was impressed with the way it avoids using recursive calls by reference node. I have been trying to do the same thing using recursion and in spite of all efforts, never quite got it to work. After I read your hint I just felt some grudge, as I am a user od LV 6i and had to go out to find a comp with LV7 installed:-). However, good advice, I thank you!
Message 4 of 6
(3,381 Views)

I'm glad I could help, Danny.  Using the VI Server technique for recursion is very slow and memory-intensive.  I have never seen a need for recursion in LabVIEW that couldn't be solved with a loop and shift registers.

-D

Message 5 of 6
(3,376 Views)

Here is an old thread that used a queue to do a recursive file list.

 

Message 6 of 6
(3,367 Views)