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: 

how to read spreadsheet in labview

Solved!
Go to solution

hello every one;

I want to read Excel sheet consist of a Matrix 3000x6825  using Labview, I already used the Read delimited spreadsheet block, but the problem is that the output array is only 3000x1 missing all other columns, How I can solve this problem?spreadsheet.png

 

0 Kudos
Message 1 of 5
(2,859 Views)
Solution
Accepted by topic author ASHLY19

I notice you have not wired the "Delimiter" input (the pink dot on the bottom of the function).  By default, LabVIEW makes the delimiter for a Comma-separated Values (.csv) file the <tab> (\t) character (go figure!).  Replace this with a "," and see if you separate the (I'm assuming "comma-separated values") into 6825 columns.

 

Bob Schor

Message 2 of 5
(2,850 Views)
Solution
Accepted by topic author ASHLY19

I'm shocked that Bob didn't mention this Smiley Wink but a CSV file is not an Excel sheet.  An Excel sheet will have a file extension of XLS, XLSX or similar. 

Excel is capable of importing CSV files but so is every other spreadsheet application (Open Office Calc, Apple Numbers, etc). 

Proper terminology is important when solving a problem. 

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 3 of 5
(2,802 Views)
Solution
Accepted by topic author ASHLY19

I agree with Bob that you need to wire the delimiter with a comma (alternatively, you can export your excel sheet as txt instead of csv, giving you a tab as delimiter).

 

To see what's going on, read your file as string instead of numeric and you'll see that each array element is an entire row, converting an entire row to a numeric will of course give you only the first value.

0 Kudos
Message 4 of 5
(2,781 Views)

@aputman wrote:

I'm shocked that Bob didn't mention this Smiley Wink but a CSV file is not an Excel sheet.  An Excel sheet will have a file extension of XLS, XLSX or similar. 


I "gave that lecture" already once today.  What, do you want me to sound like a Broken Record?

  • BS Rant #1:  "Attach Code, not Pictures!?" 
  • BS Rant #2:  "A CSV file is not an Excel file, just a Microsoft trick." 
  • BS Rant #3:  "NIPM (in its current incarnation) can be a Nightmare." 
  • BS Favorite:  "Asynchronous Channel Wires are the Cat's Meow".

Bob Schor

Message 5 of 5
(2,755 Views)