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.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Load file using a wildcard.

Hello, I am trying to open a file with a name like: "1000_Test_1.csv"

 

The problem exists because the "_1.csv" can contain any number, which I do not care about. The main this I need make sure of is that the "1000_Test" section is correct. Is there any way to use a wildcard when calling the file?

An example of the code I am currently using is listed below.

 

Thanks.

 

 

Call DataFileLoad("C:\Users\Me\Somewhere\DIAdem Tests\Folde\" & run_num & "_Test*","csv")

0 Kudos
Message 1 of 2
(4,872 Views)
Option Explicit

dim entries : entries = DirListGet("C:\temp", "1000_Test_*.csv", "filename", "FullFilenames")
If IsArray(entries) Then
  dim entry : for each entry in entries
    MsgBox entry
    Call DataFileLoad(entry,"csv")
  Next
end if

You can use code like this

0 Kudos
Message 2 of 2
(4,855 Views)