LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read from excel file to display on VI table

I had submitted a previous similar post which I did not phrase myself properly. Can anyone show me how can I read an excel file that contains information as shown below to my table.vi that I had attached? One more question. Is it possible to attach more than 1 file in this forum?

Thanks!

name phone no
abcd 123456789
. .
. .
. .
. .
wxyz 987654321
0 Kudos
Message 1 of 9
(4,557 Views)
mm, your problem is actually 2 problems:

1. How to read an excel file into Labview
As far as I know the vi "read spreadsheet file" does not read excel files directly. Solutions are:
- half automated: in excel, save as CSV or tab delimited text file
- fully automated: write a windows shell script (with labview) to automatically save the excel file as a CSV first.
After conversion, you can use the "read spreadsheet file" vi to read the data into an array
(Maybe the report generation toolkit can read excel files directly). Other ways may exist..

2. convert array into a table
A table datatype is 2D array of type string. Make sure you flatten your array to string if it isn't already and wire it into the table.

That should do it. If you need it, I can show you how to make the windows shell script. But beware, these scripts are not very portable between systems and OS versions.

Aart-Jan
0 Kudos
Message 2 of 9
(4,553 Views)
This question is posted so often... you will find an answer here. Then just wire the vi output to your table. As simple as that !

To attach several files to the same post, you have first to "edit" it. Click on the button at the upper right cormer of the message, as it appears once posted. Then select "edit message". This option is valid only during a short period of time after posting.

CC
Chilly Charly    (aka CC)
0 Kudos
Message 3 of 9
(4,540 Views)

Hi  guys,

    I am new to  Labview and i have similar question. I went through all the possible replies but could not find one for my question. I have the data collected from a test in an excel format. I intend to plot it on a 3D graph. I am currently doing it by saving as tab delimited text file. I have report generation on my computer but none of the Vis in it directly reads from excel. Can you tell me some other way i can work around with this problem. Can you elaborate about writing windows shell script to directly save it as Text File.

Thanks,

Bhushan

For Latest TECH News check out my blog at http://directfromdigg.blogspot.com
0 Kudos
Message 4 of 9
(4,456 Views)
How do I write LV code to convert Excel(.xls) into text file (.txt) or CSV file ?
0 Kudos
Message 5 of 9
(4,101 Views)
According to your post at http://forums.ni.com/ni/board/message?board.id=170&message.id=238119#M238119, you solved the problem of reading an Excel file. do you still have an issue? Once you have data from Excel in an array, you just use theWrite to Spreadsheet File.
0 Kudos
Message 6 of 9
(4,095 Views)
I was using Read From Spreadsheet File.vi, and it works OK if I already have my Excel converted into a Wordpad doc (.txt extension) outside of LV in Windows environment. What I want is having LV converting the Excel into .txt file internally to save operator's time. Is there somekind of script file that LV can call to execute the conversion ?
Thanks
dphan128 
0 Kudos
Message 7 of 9
(4,087 Views)
That's a much different issue. Did you go to the Excel Board to look at the examples on how to read a native xls file directly into LabVIEW? That's one option and would be instead of Read From Spreadsheet File. Your other option is to use Excel's ActiveX properties and methods to open a file and save as tab or comma separated data. I have not done that but I would again recomend you check the above board and also do a forum search of 'Excel' to see if an example exists.
0 Kudos
Message 8 of 9
(4,079 Views)

I'm using Read from Spreadsheet File.vi since it is much easier to implement than going with ActiveX properties (as some have posted in the "Excel" board). The reason I'm asking about conversion because Aart-Jan already mentioned it in this thread earlier (actually 2 years ago!), and I'm more interested in going that round than going with ActiveX. So I just want to find out more detail from him. But I guess he is not active with the forum anymore!

dphan128 

0 Kudos
Message 9 of 9
(4,070 Views)