LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I properly identify a file type in LabVIEW?

Hi folks !!!

I need to build a vi which identifies file tipes. Can anyone help me with it?
0 Kudos
Message 1 of 6
(4,172 Views)
WIndows typically uses the file extension (.exe, .pdf, .xls, vi, etc.) to define the file type.
 
If you have LabVIEW 8.2, there is a tool in the advanced file functions palette with name "get file extension". Basically it does a "match pattern on the filename with pattern "\.[~\.]*$".
 
If you need more than that, please be more specific. 🙂
 
What is your OS? What kind of file types?
Message 2 of 6
(4,166 Views)
Altenbach,

basically in my application I need to open a text file - specified by the user - containing data to be processed by my application which is configured im the following manner: the first column is the date and time of the measurement, the following six columns contain the data measured.

What I thought about doing is checking if the file appointed by the user matches the above characteristics before doing anything else.

Another thing, I didn´t find the function you mentioned - get file extension - anywhere in the functions palette.

Thanks for so fast an answer !!! Smiley Happy
0 Kudos
Message 3 of 6
(4,155 Views)
The function is ONLY available on 8.2. Maybe you only have 8.0 or lower?
 
Seems your file is small and your problem different. SImply read it in, parse it, and then decide if the format is valid. 🙂
0 Kudos
Message 4 of 6
(4,144 Views)

Thank you for your answer really appreciated.

0 Kudos
Message 5 of 6
(3,337 Views)

In the future feel free to give thanks by giving kudos rather than replying to really old threads.  Oh and in modern LabVIEW versions there is a Get File Extensions on the File I/O palette to help with this.  Before that there is an OpenG function too.

0 Kudos
Message 6 of 6
(3,315 Views)