Jump to content

Default file type for saved data


Recommended Posts

Hi,

I am collecting some data and saving it to a csv file for analysis in Excell, is there some way to set the default file extension that the data gets saved as?

I can set it to save in csv format, but when I get the dialogue box asking where to save the file it always defaults to "All Files (*.*)" as the file type and you have to manually enter .csv on the file name. Thats not a problem as long as you know to do it but I want to make it so that it defaults to *.csv so that when other people use the program they won't get it wrong and end up with a file they can't open.

Thanks!

Link to comment

The 'File Dialog' express VI has an input called pattern (all files) setting this to *.csv will default the files with an extension of csv.

By using this input and the accompanying pattern label you can mimick your own filetypes. For instance you could set pattern label to Measurement files.

If you have a path control you can set the browse options to achieve the same effect.

However I advise you not to use text based files for Excel, either write directly to excel via the ActiveX interface, or save your data as TDMS and use the Excel TDMS plugin to open the file. This will prevent errors from localization.

Ton

Link to comment

Open your own dialogue prompt (File I/O>>Adv File funcs>>File Dialog) and pass the filepath to the save vi. The File dialogue express VI enables you to set the default extension and passing the filepath means that the default dialogue won't be invoked.

Link to comment

QUOTE (Ton @ May 3 2009, 02:51 PM)

The 'http://zone.ni.com/reference/en-XX/help/371361E-01/glang/file_dialog/' target="_blank">File Dialog' express VI has an input called pattern (all files) setting this to *.csv will default the files with an extension of csv.

By using this input and the accompanying pattern label you can mimick your own filetypes. For instance you could set pattern label to Measurement files.

If you have a path control you can set the browse options to achieve the same effect.

However I advise you not to use text based files for Excel, either write directly to excel via the ActiveX interface, or save your data as TDMS and use the Excel TDMS plugin to open the file. This will prevent errors from localization.

Ton

LOL.

Looks like you pressed the send button just before me :P

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.