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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

search archive in pc hard disk

Hi, 

What I want is to verify the existence of a file on the hard disk of your PC, but the filename must be composed with a fixed part and variable part, ie, the variable would be something like "*" when a search assistant with Windows. 

Is vi "Check if File or Folder Exists" admits a path in which part of it is either a character? For example: one might say that this path "C: \ file_ ***. DAT" where each "*" could be anything (001, 002, 003, ABC, etc ...? 

Thanks and best regards
0 Kudos
Message 1 of 4
(2,169 Views)

Hi aristoy,

 

there's a "list files" function in the appropriate palette. You can use this to get an array of all interesting filenames... Just read the context help for this function!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,154 Views)

Thanks GerdW,

 

Now, i have an array with the files, but the next is: how can i identify that i have a positive result with a TRUE?

 

What i want to do is give a binary result (0 or 1) if i find a file with the correct pattern.

 

Thanks

0 Kudos
Message 3 of 4
(2,144 Views)

Hi aristoy,

 

you can wire a pattern to "file list"! When the output array (of filenames) is not empty then files fitting the pattern are found. So you only have to check for the array size with a greater than zero Smiley Wink

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(2,140 Views)