12-30-2008 01:49 PM
12-30-2008 03:54 PM - edited 12-30-2008 03:55 PM
The best way to go forward would be to post the VI so that we can tell you exactly how the data is being written to the file. It might be 'binary data' (32 or 64 bit or else) so excel would just show garbage.
However, you can try to open it with excel as follows:
Rt click the file, select 'open with', then 'choose program'. then select 'MS excel'.
The file should open in excel and you can then see if the values make sense.
A better way of opening the file is excel is to open Excel, then select 'open...' and change the 'types of files' to 'All files (*.*)'. this way, you can see the '*.dat' file also. Once you open it, excel will display a wizard which will let you specifiy if it is a tab delimmited, comma separated or else. You can then experiment to see which gives you the correct data in each column.
Hope this helps.
Cheers!!!
01-02-2009 11:37 PM
01-04-2009 10:35 AM
Zinnium wrote:
try this. it will open in excel... has a formatting question: press yes and enjoy
Or, you could simply use the Write to Spreadsheet File
function. That will create a text file, but it will be formatted so you
can open it in Excel, or other spreadsheet program.
01-04-2009 02:36 PM
01-04-2009 03:31 PM - edited 01-04-2009 03:36 PM
Zinnium a écrit:
Yeah, but I work in industry and not in the lab. My clients want an excel sheet, and not a text file. Its easier to give them what they want and not argue with them.
If you use the .xls extension instead of a .txt extension when naming the file, the file will still be a text file, but will be considered as an Excel file (and opened directly with Excel 😛 ). This is the easiest method, something you did in your ExcelForFree VI, but that applies also to the files saved directly with the Write to spreadsheet VI !
01-04-2009 04:06 PM
This is actually different. By using this concept you can create a real excel spread sheet with macros and everything. You can still open it up and read from it, edit it, and write to it again. You can add sheets, set fonts, set colors, adjust column and row sizes and even have more control over it than the actual NI MS Offices toolkit has.
That is the power of this method, and its not a text file.
Shane
01-04-2009 05:22 PM
Zinnium a écrit:This is actually different. By using this concept you can create a real excel spread sheet with macros and everything. You can still open it up and read from it, edit it, and write to it again. You can add sheets, set fonts, set colors, adjust column and row sizes and even have more control over it than the actual NI MS Offices toolkit has.
That is the power of this method, and its not a text file.
I'm probably missing something here. The method you propose creates the HTML table file below (opened with the Read from Text File VI (does this implies that it is a text file ? ;)). We are far from an Excel (native) file ! 😉
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<!-- Constructed with LabVIEW Report Generation -->
<HEAD>
<TITLE></TITLE>
</HEAD><BODY>
<TABLE BORDER="1">
<TR>
<TD WIDTH="100">a</TD>
<TD WIDTH="100"></TD><TD WIDTH="100"></TD>
<TD WIDTH="100"></TD>
[.........]
<TD WIDTH="100"></TD>
<TD WIDTH="100"></TD>
<TD WIDTH="100"></TD>
<TD WIDTH="100"></TD>
</TR>
</TABLE>
</BODY>
</HTML>
As a matter of fact, Excel can open and interpret html files. Fine. Once imported into Excel, you can do whatever you want with the file content. Not really surprizing. Of course, the same considerations applie to the tab-formated text files generated using the Write to Spreadsheet VI. They have the same "reality" as html files disguised with a .xls extension.
Of course if you plan to include a complete set of html commands into the file, your method is perfect. But, apart using the NI report generation toolkit (a solution that is apparently not the one you recommand), I personnaly would not go that way ! Have you developed your own html toolkit ? Could you explain what I'm missing here ?
(BTW, do you know a way to open an Excel sheet with the NI report generation tools ?)
01-04-2009 10:22 PM
Zinnium wrote:
Yeah, but I work in industry and not in the lab.
So do I. I still use the Write To Spreadsheet File and use the .xls extension, as CC mentioned. Works perfectly fine.
01-05-2009 12:59 AM
chilly charly wrote:
Zinnium a écrit:
Yeah, but I work in industry and not in the lab. My clients want an excel sheet, and not a text file. Its easier to give them what they want and not argue with them.If you use the .xls extension instead of a .txt extension when naming the file, the file will still be a text file, but will be considered as an Excel file (and opened directly with Excel 😛 ). This is the easiest method, something you did in your ExcelForFree VI, but that applies also to the files saved directly with the Write to spreadsheet VI !Message Edité par chilly charly le 01-04-2009 10:36 PM
One thing I have noticed however is that saving with a .xls file extension will not let you open the excel file while data is being written, but with a .txt extension you can. I had this issue when notes needed to be added to the data file while the program was still running (example, liquid nitrogen was added to the system and this had to be marked in the data file). I saved as a .txt extension and after the program was done its just a simple right click on the file, open with excel, or a change of the .txt to .xls. Hardly time consuming...