07-16-2009 10:45 AM
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.
Solved! Go to Solution.
07-16-2009 11:17 AM
07-16-2009 12:29 PM
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"
07-17-2009 03:04 AM
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.
07-17-2009 03:15 AM - edited 07-17-2009 03:18 AM
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.
07-17-2009 03:36 AM
07-17-2009 03:42 AM
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.
07-17-2009 03:51 AM
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
07-17-2009 03:57 AM
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.
07-17-2009 05:10 AM
Just managed top get it working. The attached picture shows the code I used.
Thanks,
Matt