LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get file pattern label information

Solved!
Go to solution

Hello,

I have simple question, but I am afraid about answer, that there is no solution. I have a file control with several user custom patterns (eg. CSV file (*.csv), Excel file (*.xls), CSV tab file (*.csv). Each of this file patterns are standalone in file dialog (separate line). I would like to get an information when I choose file under file pattern label CSV tab file, because CSV File and CSV Tab file has a same pattern, but inside in the file they are different. And I want to start correct subVI to open this file correct. Have anybody a solution via file dialog? Thank you.

0 Kudos
Message 1 of 4
(2,572 Views)

Hi

If the CSV file and CSV tab file have the same filetype then I don't there is any way to filter them separately.

However, if you are looking to select a particular subVI based upon the filetype then can you not open the CSV and maybe parse the contents of the file to decide whether it's a CSV or CSV tab file and then select the correct subVI as a result ?

 

0 Kudos
Message 2 of 4
(2,563 Views)
Solution
Accepted by topic author JiriUraj

I will solve my problem, that I am goging to use Windows .NET OpenFileDialog function, this will provide me an information about filter index and file path/name. Simple:-)

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

By definition, a file with a CSV extension (comma separated values) should not have tab separated values saved in it. Excel uses a .txt file extension for tab delimited file.  However, for your application, you could save the files with a TSV extension so that the format of the document is clear to the users.  There are other ways of handling this without invoking .NET. 

 

tab_delimited.png

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 4 of 4
(2,523 Views)