08-28-2012 07:02 PM
Hi all, I am using the "Write to Spreadsheet File" Vi to write data to text files. This data can be read by any text editor, such as MS notepad, or excel. The problem is that
windows sees these files as being of an unknown type, and I have to explicitly tell windows what program to use to open these files. Also, for some reason the
"Always use the selected program to open this kind of file" box is greyed out. So I can't assign a file type to these files.
Has anyone else encountered this problem? Do you know how to fix it? And what type of files does "Write to Spreadsheet File" generate?
Thanks for your help,
Solved! Go to Solution.
08-28-2012 07:16 PM - edited 08-28-2012 07:18 PM
Seems that you haven't given the file extension when you give the file path and file name so thats why it shows as unknown file type. By default Spreadsheet vi generated tab delimited files.
08-29-2012 07:18 AM
What extension are you using to create your files? I agree that it sounds like you are not supplying a file extension. Append a ".txt" to your file names before writing and Windows will play more nicely with you. Or if you are using a comma as the delimiter, use ".csv".
08-29-2012 10:28 AM
Thanks for your replies. I'll try appending a file extension to the files being written and see if that helps.
08-29-2012 10:57 AM
Yup, it worked. I was used to using "write to measurement file" which automatically assigns a file type.
Thanks again,
09-14-2012 11:15 AM
Is there a way to set it so that when a user is prompted for a file name the file type is automatically set to .txt? Would save countless needless ".txt" appends to file names.
I know I could check the filename afterward and add a ".txt" if it was missing but it would be nice if the user had that feedback ahead of time.
Thanks
Chuck
09-14-2012 11:27 AM - edited 09-14-2012 11:28 AM
Like this...
09-14-2012 11:40 AM
Thank you, that is very helpful. I generally avoid the Express VIs but in this case (and other cases of user prompts, I have noticed) they come in useful.
Chuck