NI Home
Cart Cart | Help
Hello Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI
You are here: 
NI Home > NI Developer Zone > NI Discussion Forums


Reply
Member
Meky
Posts: 5
0 Kudos
Accepted Solution

How to load an entire directory into DiAdem

I can load my individual .ADF files by calling DataFileLoad but I have about 120 files in three folders in one parent folder. 

Is their a way to search for all these files (perhaps using the datafinder which I configured for .adf files) and then load them all together?

 

Thanks, 

Omar

Member
AndreasK
Posts: 199

Re: How to load an entire directory into DiAdem

dim result : result = DirListGet("C:\tmp", "*.adf", "filename", "FullFilenamesRecursive")
dim fl : for each fl in result
  DataFileImport fl
Next

or using Datafinder which can be used to with more than file extension to deterermine which files to load.

 

Dim DataFinder : Set DataFinder = Navigator.ConnectDataFinder("My DataFinder")
Dim Query : Set Query = DataFinder.CreateQuery(eAdvancedQuery)
Call Query.Conditions.Add(eSearchFile, "folder", "=", "C:\tmp\*")
Call Query.Conditions.Add(eSearchFile, "fileName", "=", "*.adf")
DataFinder.Search(Query)

Dim File
For each File in DataFinder.Results
  DataFileImport File.Properties("fullpath").Value
Next

 

Member
Meky
Posts: 5
0 Kudos

Re: How to load an entire directory into DiAdem

Thanks, that was really helpful!

By using this web site, you accept the Terms of Use for this web site. Please read these Terms of Use carefully before using any part of this site. Please go here for information on ni.com's copyright infringement policy.
My Profile | Privacy | Legal | Contact NI © 2011 National Instruments Corporation. All rights reserved.    |    E-Mail this Page E-Mail this Page