LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Look through sub-directory

Hi,

I would like to know how to look for in a root directory, every files
with the extension (say) *.dat. The search of those files will be in the

root directory and in any (if any) others sub-directories.

Is that possible with LabView

Thanks.
Kind regards.
0 Kudos
Message 1 of 4
(4,270 Views)
Yes it is. If you go to advanced file I/O functions and use the 'list dir'
vi. This has an input called pattern. Put your *.dat here as text and it
will return files of that type. You can also use the pattern to sort files
listen in file open/replace/close.

s gontier wrote in message <37847006.6810A626@dl.ac.uk>...
>Hi,
>
>I would like to know how to look for in a root directory, every files
>with the extension (say) *.dat. The search of those files will be in the
>
>root directory and in any (if any) others sub-directories.
>
>Is that possible with LabView
>
>Thanks.
>Kind regards.
>
0 Kudos
Message 2 of 4
(4,270 Views)
.... but List Directory VI doesn't include subdirectories in its search, does
it? I could be wrong.

When I use this type of thing, I include a "Browse.." button which is hooked
up to a case statment. If Browse changes from F to T, I don't give the List
Dir VI a valid path, so a dialog box comes up.

If you're new to LabVIEW, this might be difficult because of the mechanics of
the Browse button must be set correctly, and you must also make sure the
dialog box only comes up when it changes from F to T, not just when it's True
(use shift registers).

You might be able to also write a VI to programatically search all
subdirectories and build a database that has all file names that end in a
ceratain extention.

Hope this helps.

Rick

rick@csciences.com

Chesapeak
e Sciences Corp.
1127B Benfield Blvd Millersville, MD 21108

Tel: (410) 923-1300 x3430 Fax: (410) 923-2669


I've tended to dismiss the whole Open Software
movement as more religion than business. But let's
face it. Businesses come and go, but religions
stick around for thousands of years. If Bill Gates
and his employees plan to take on the Linux gang,
they better be prepared for a buzz saw.

--Jack Bryar
0 Kudos
Message 3 of 4
(4,270 Views)
Yes, it's possible and easy.
In your "File I/O pallet, under "advanced" there is a VI called "List".
Simply tell it where to look, what to look for, and it will give you file
names and directories if you want them. Just remember for pattern, use your
wild card [*] for the file name or extension, whatever you are looking for.
Hope this helps.
Craig

s gontier wrote:

> Hi,
>
> I would like to know how to look for in a root directory, every files
> with the extension (say) *.dat. The search of those files will be in the
>
> root directory and in any (if any) others sub-directories.
>
> Is that possible with LabView
>
> Thanks.
> Kind regards.
0 Kudos
Message 4 of 4
(4,270 Views)