10-14-2008 02:08 AM
does anyone know how to open a file using wild cards in the name.
For example, a certain folder will contain a number of files, with the name constructed as follows:
CALDB_ then a 6 digit serial number, and then 14 characters which could be ANYTHING. so it might look like this
CALDB_123456_33KA1234567890.txt
or
CALDB_123457_33KA1234567890.txt
The key part of the file name is the 6 digit serial number which is unique, and the CALDB_ which is always the same.
I would like to use a file open command with the file name something like CALDB_123456_*.txt, but it doesn't appear to work.
Can anyone help?
Thanks
Solved! Go to Solution.
10-14-2008 02:12 AM
10-14-2008 02:23 AM
10-14-2008 03:22 AM - edited 10-14-2008 03:22 AM
Hi Dylan,
I have been searching along our forum, and found a similar question for using wildcards in selecting files. An active user (unclebump) replied on this request with a VI, with which you can select a folder on your computer which is scanned for certain files. I've adjusted this VI for selecting the CALDB_* files. Enclosed you will find this file (zipped) including my test folder.
Maybe this will be helpfull for your application.
Best regards,
Peter Schutte
10-14-2008 03:36 AM
Hi Dylan,
for a better match to the files it is advisable to use a pattern like "CALDB_??????_*.txt" to find exactly all files with with Prefix CALDB, underscore, six digits, underscore, the 'don't care'- rest and file ending.
Hope this helps,
Dave
10-14-2008 04:09 AM
Hi Peter,
yes it does help, it does exactly what I need, I have tested it out and it works fine.
Thanks very much