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: 

saving to spreadsheet file *.txt

Solved!
Go to solution

Hello.

 

I have a program that  creates 2D array, of measurements.

Then, I want to give user an option to save it to a file.

So i chose LV function "write to spreadsheet file.vi"(maybe you can suggest other option).

Then, when it runs dialog opens to ask where to save the file. The file name empty, and file type is "All Files(*.*)". What I want is to set the file type to *.txt by default, so the user don't have to care about it.

How can i do it?

 

Thanks 

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

In this case, the user would not be allowed to choose the location of the save file, only the name of it (of course, you can ask the user for the location input too, but that would be quite risky and not very comfortable):

Text.png

 

I bet there are better workarounds or maybe it is possible to set it up without any workarounds, just I don't know the method. Yet.

Message Edited by Giedrius.S on 02-21-2010 03:24 PM
---

While evaluating my code please have in mind that I am a LV novice. Therefore sometimes my code might violate some coding rules that I have to learn about myself. But how else could I do that... 🙂

Chart zoom with "Mouse Over" effect
0 Kudos
Message 2 of 4
(2,752 Views)

Another version:

Text2.png

 

Remember to use error clusters for the property nodes. 

 

In this case, the .txt format will be default if the user will choose the path and to save the file or not before running the program. But it still shows the "All files" if the save dialogue is opened during the run-time.

---

While evaluating my code please have in mind that I am a LV novice. Therefore sometimes my code might violate some coding rules that I have to learn about myself. But how else could I do that... 🙂

Chart zoom with "Mouse Over" effect
0 Kudos
Message 3 of 4
(2,743 Views)
Solution
Accepted by topic author Tacchi
The File Dialog function has an input called 'pattern (all files)'. Set this to *.txt.
Message 4 of 4
(2,728 Views)