LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

can't read a written spreadsheet

I'm a little confused about this one. I use 'Write to spreadsheet file.vi' to store a 2d array. (I realize that using this method does not assign the '.xls' extension to the saved file.) I can open this array in LabVIEW once again by using "read from spreadsheet file.vi". if i choose not to read the data in LabVIEW, I can use a program like Excel to open the saved spreadsheet. (the data looks good - 2 columns)

I would assume that the 'read from spreadsheet file.vi' should work for excel-created files (.xls extension), but it doesn't. I receive a list of zeros and the occasional one. I know people suggest using ActiveX to retrieve the data, but why should i have to? It's just 2 columns of numbers either way. one's a text fi
le and one a spreadsheet. are the delimiters different? thanks for the clarification.

Philip
0 Kudos
Message 1 of 9
(3,740 Views)
Hi Philip,

there is a lot of confusion about what a spreadsheet is.
Formarly a spreadsheet was a piece of paper with lines on it forming rows and columns. A person was writting numbers and text into the cells. Some of the numbers were calculated by the person.
This peace of paper have been transformed into a electronical representation. And this was a simple text file with some delimiters for the columns and rows. You can use a simple text editor to change the data but you have to make the calculations by your own.
Some people though that it would be good to store also the formulas and a lot of other things in the file and provide a user interface to this file. So a lot of programs were born all talking about spreadsheets. Microsoft Excel is only
one of them. There are at least two major products for the same task one is Lotus 1-2-3 and StarCalc. Each of them use their own file format to store the data.
The term spreadsheet for NI is a text file containing only the data and the formulas are your VIs.
The term spreadsheet for Microsoft, Lotus and StarCalc is a file containing data, formulas, formatting information, ...

I hope this clarified something about spreadsheet and why NI cannot read Excel, Lotus or StarCalc files.

Waldemar

Not mentioning all the other spreadsheet products out there in the world and not only on the windows platform.
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
Message 2 of 9
(3,736 Views)
You will se the difference between a spreadsheet file and an Excel file if you open this files in an text editor (Notepad or similar). When spreadsheet file, you can se rows and coloumns. When Excel file, all you see is a bunch of program codes. Giving a spreadsheet-file a .xls extension does of course not change the contents of the file. Only it makes you open the file into Excel by default because your computer then think this is an Excel file.
Message 3 of 9
(3,736 Views)
Hello
My problem seems similar to Philip's. The function "read from spreadsheet" kind of opens my file, but gives only the integers of the values (e.g. 0.000 instead of 0.678 or 2.000 for 2.013). When I change the format string (%.3f) it just affects the number of zeros...
My file seems okay - at least excel opens it without troubles.
Thanks for any hint.
Goeran

btw: Is it usual for that forum, that the whole post is lost when one tries to attach a file with an invalid suffix? I would attach my files, but ...
0 Kudos
Message 4 of 9
(3,548 Views)

If you hit the preview post, you will lost any attachments so you might want to retry.

Is the file you are trying to read a native Excel file? If it is, then Read From Spreadsheet will not work as explained above. You can do a save as in Excel and save it as comma or tab separated text.

0 Kudos
Message 5 of 9
(3,540 Views)
Thank you,
the file I try to open should be a labview file, created with the "write to spreadsheet"-function. It doesn't seem to have a suffix (?)
It is attached now
Download All
0 Kudos
Message 6 of 9
(3,535 Views)
Hello Orthopedix,

you should use the following formatter:
%.;%f
I think you use a computer where the standard decimal sign is ',' and not '.'
The %.; tells LV to parse it with . as the decimal sign!

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 7 of 9
(3,526 Views)

I don't see a problem. The picture shows the results when I run it.

Message Edited by Dennis Knutson on 10-18-2006 11:57 AM

0 Kudos
Message 8 of 9
(3,524 Views)
Hi Ton,
you're right. Thank you.
I forgot to mention, that I use a german OS. Should have known that, after all that trouble that I always have with imported files...
Thank you too, Dennis.
Goeran
0 Kudos
Message 9 of 9
(3,509 Views)