LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reading a spreadsheet.

I have an (Mac) excel generated spread sheet but read from spreadsheet.vi seems to be only able to read the first row. I am correctly wired, not wired to the read first row connector.I have also tried several different forms of the spreadsheet. tab delimited, comma delimited, etc. I am running version 7 and the spreadsheet is attached.

thanks
0 Kudos
Message 1 of 10
(5,182 Views)
Sorry, make that it only reads the first column
0 Kudos
Message 2 of 10
(5,179 Views)
What format do you try opening the spreadsheet with.  You can choose from %.3f which is Double format, %d which is Integer format, or %s which is String format.  Try using the string format, I know for a fact that you can bring up all the rows and columns with that format.
 
Good luck
0 Kudos
Message 3 of 10
(5,170 Views)
You didn't post your code, so it's impossible to say what may be the problem, but the following works to read the contents:


Note: Since some of the columns have text information, the stock "Read from Spreadsheet File" in LabVIEW 7, which is what you said you're using, will probably be inadequate for you. You probably want to read the contents in as a 2D array of strings. You can easily modify the stock "Read from Spreadsheet File" VI to use a 2D array of strings. Just make sure you don't overwrite the one that comes with LabVIEW.

Message Edited by smercurio_fc on 10-01-2007 10:00 AM

Message 4 of 10
(5,166 Views)
Here's the code. I may not have been looking at enough of the spreadsheet to tell whats going on. I also made some changes to the spreadsheet. I formating still isn't write. The spreadsheet is formatted as text but numbers are display as floats and letters are not displayed at all.
0 Kudos
Message 5 of 10
(5,155 Views)
You didn't change the format going in...
This works fine for bringing up the entire spreadsheet.
0 Kudos
Message 6 of 10
(5,152 Views)
I've tried %.3f and %s. Neither seem to work. I'm also running 7.0. Do you think that's the problem?
0 Kudos
Message 7 of 10
(5,151 Views)
Read what smercurio_fc said about the Read From Spreadsheet function in 7.0. It cannot read strings. There are instructions on the block diagram on how to modify it to do so. And, as he said, when you make the modifications, save it with a new name and in a different location.
0 Kudos
Message 8 of 10
(5,143 Views)
Doh..
 
I missed the part where you said your running 7.0.  My apologies, go with what Dennis/smercurio suggested.
Message 9 of 10
(5,138 Views)
Thanks guys.
Once more, I'd be lost without you.
0 Kudos
Message 10 of 10
(5,113 Views)