From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read in spreadsheet file

Solved!
Go to solution

Hello,

 

This is a very basic question about reading in spreadsheet files. How do I do it please?

 

I have a spreadsheet of 1 row and 256 columns. What separates the data in a spreadsheet file? Is it tab.

 

My current .vi doesnt want to read in the spreadsheet for some reason.

 

Thanks,

 

 

0 Kudos
Message 1 of 6
(2,467 Views)

nevica wrote:

I have a spreadsheet of 1 row and 256 columns. What separates the data in a spreadsheet file? Is it tab.


Is that a question?  Do you have a sample file that we can look at?  It is a total shot in the dark without that.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 6
(2,456 Views)

Hi,

 

Here is the file I am trying to read in attached.

 

You'll notice that the spreadsheet file is made up of 1 row and an identical column in an attempt to read in the file.

 

The spreadsheet file input I am using is shown below.

 

Capture6.JPG

 

 

0 Kudos
Message 3 of 6
(2,441 Views)
Solution
Accepted by nevica

That function does not read xls or xlsx files.  It reads ASCII spreadsheet files.  You could either save your Excel file as a CSV (File->Save As, then change the type to CSV) or a text file and use that VI.  Or you can use some ActiveX commands to read the data from Excel.  Changing the file type is a lot easier.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 6
(2,426 Views)

Read from Spreadsheet File DOES NOT read Excel files.

 

It reads text files that are setup as a 2-D array with with a delimiter between "columns" and an end of line character separating "rows".

0 Kudos
Message 5 of 6
(2,425 Views)

@crossrulz wrote:

You could either save your Excel file as a CSV (File->Save As, then change the type to CSV) or a text file and use that VI. 


No, never do CSV files, they are evil because some countries use comma as decmal seperator, causing unpredictable results. It is much better to export it as text file as in the second suggestion, which will give you tabs as delimiters and which is aready the default delimiter for "read from spreadsheet file".

0 Kudos
Message 6 of 6
(2,419 Views)