LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.txt file extension

Solved!
Go to solution

Labview automatically saves a text file as a readable text file but it has no .txt or .text file extension on.  Is there a way in which you can make labview save a file automatically with a .txt file extension so it can be opened directly by notepad.  Rather than having to choose aprogram to open it with every time I try to access one of the files.

 

Thanks,

Matt.

0 Kudos
Message 1 of 10
(9,434 Views)
The file write functions save a file with whatever name and extension that you provide. Nor does 'LabVIEW' automatically save a file in any type of format. The function that you choose will save in text or binary format. Explain what functions you are using and what parameters you are passing to it.
Message 2 of 10
(9,426 Views)

The quick and dirty way around this is to just type .txt at the end of your desired file name

 

ie, instead of "example" as your file name, type "example.txt"

0 Kudos
Message 3 of 10
(9,414 Views)

Thats what we currently do but we need to do this for hundreds of files so it gets a bit annoying after a bit.  A way of doing this automatically would be good.

 

Thanks,

Matt.

0 Kudos
Message 4 of 10
(9,400 Views)
Solution
Accepted by gilgad2000

gilgad2000,

It depends on your VI. If you are using the "Path Control" tool, you can open its "Browse Options" and write .txt at the Pattern box.

If you are not using it, you can also concatenate a ".txt" string at the end of the file path (use "Strip Path", "Concatenate Strings" and "Build Path" functions) just before using it on the saving function.

Message Edited by Danigno on 07-17-2009 03:18 AM
Message 5 of 10
(9,394 Views)
If you use the File Dialog.VI then you could wire the "pattern (all files)" with a string constant "*.txt". Running the VI will open the file dialog, which shows only *.txt files, and if you enter a name the extention txt will be automatically appended.
Message 6 of 10
(9,387 Views)

How can I do the path controll is I want to the user to select the path rather than to just write it to set place??

 

Thanks,

Matt.

0 Kudos
Message 7 of 10
(9,381 Views)

I don't understand your last posting.

 

If the user shall select just the path for hundreds of files then you programmatically build the file path and append ".txt".

 

If the user shall select the disk location and file name then use the "File Dialog.VI" from the File I/O > Advanced file functions Palette as described above. You can also wire a start path for convenience of the user.

 

 

Jörn

0 Kudos
Message 8 of 10
(9,374 Views)

When I say hundreds I meanmore like 10's.  They are normally saved in a similar place but in one of many folders.  Basically every time they save a reading it should automatically be a text file with the .txt file extension.

 

Thanks,

Matt.

0 Kudos
Message 9 of 10
(9,368 Views)

Just managed top get it working.  The attached picture shows the code I used.

 

 

Thanks,

Matt

0 Kudos
Message 10 of 10
(9,339 Views)