LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

read file without knowing full name

Solved!
Go to solution

Dear All,

I want to read data from a file but without knowing the file's full name.

For example i have data files from a program that the first letters of the data files are the date and the rest some numbers i cannot predict i.e 20081027_5323621.

Is it possible to read this file by knowing only the characters that correspond to the date?

thanks!

0 Kudos
Message 1 of 13
(4,389 Views)

Yes,

 

You can set a pattern in the file dialog that points to the date (formatted).

The output of the file dialog will be the complete file path for the file that was selected..

 

One question..  Do you want a popup window to browse for the file?  to allow selecting one of the matching file(s)...

Because there may be more than one file that has a matching date...

 

R

 

Message Edited by JoeLabView on 10-27-2008 01:09 PM
0 Kudos
Message 2 of 13
(4,384 Views)
You could try using List Folder to get a list of all the file names in the directory.  Then search the resulting array for the file that matches whatever your pattern is.  Then open that file.  Of course you will need a case in the event no files match the pattern.
0 Kudos
Message 3 of 13
(4,383 Views)

What  Joelabview proposes is what i was looking for , but i cannot find this vi anywhere. what is the name ? (i have labview 8.2)

thanks 

0 Kudos
Message 4 of 13
(4,374 Views)

The function that Joelabview proposes was replaced in LabVIEW 8.2 with the File Dialog Express vi.

 

Look under Functions>Express>Input for the express vi "File Dialog".

 

 

0 Kudos
Message 5 of 13
(4,364 Views)

hi again,

thanks i found the vi.

i have two questions though

do i join my string i.e 20081027*.* to the default name or pattern input of the VI?

and second is it possible that it finds the file without a dialog box appearing, and only appear if the file is missing?

thanks again

 

0 Kudos
Message 6 of 13
(4,360 Views)

That is why List Folder will work.  It has a pattern input as well.

Message Edited by Ravens Fan on 10-27-2008 02:21 PM
Message 7 of 13
(4,354 Views)
Solution
Accepted by topic author theodoros

ok that worked fine.

thanks a lot!!!

0 Kudos
Message 8 of 13
(4,337 Views)

Hi,

I would like to use this 'List Folder' in Lab VIEW7.1

Can you please forward this VI to me?

Thanks in advance.

 

Regards

Rudresj

0 Kudos
Message 9 of 13
(4,012 Views)

Hi Rudresj,

what do you mean? The "List Folder" function is available in the "File I/O" palette.

 

Mike

0 Kudos
Message 10 of 13
(4,010 Views)