LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Exporting an array to excel sheet

Solved!
Go to solution

I have designed a vi to export the array to excel sheet. However, a row of data is logged in a cell only. Also, some data in the array is up to 1e-06, but the data logged in .csv is up to 1e-03 only. How can I solve these problems?

 

 

Download All
0 Kudos
Message 1 of 5
(1,545 Views)
Solution
Accepted by topic author hohi7745

Hi hohi,

 

you create a CSV file. This is just a delimited text file, so please don't call it "Excel file"...

 

Two suggestions:

  1. use the delimiter char expected by Excel for CSV data, for me this typically is a semicolon...
  2. use a format specifier for your numeric data as expected by Excel: is there any decimal separator mismatch (comma vs point)?
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(1,528 Views)
Solution
Accepted by topic author hohi7745

As rightly pointed out by GerdW Excel File is Different from CSV (Comma (Delimiter) Separated Value).

 

LabVIEW by default assigns Tab as delimiter, you need to map Comma (,) in the write to Spread Sheet Function.

 

Also its better to convert Data from Decimal Array to String Array and Append with Column Header's and write as String Array.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 3 of 5
(1,510 Views)

@GerdW wrote:

Hi hohi,

 

you create a CSV file. This is just a delimited text file, so please don't call it "Excel file"...

 

Two suggestions:

  1. use the delimiter char expected by Excel for CSV data, for me this typically is a semicolon...
  2. use a format specifier for your numeric data as expected by Excel: is there any decimal separator mismatch (comma vs point)?

Um.. The delimiter expected in a Comma Separated Values (.csv) file is a comma.

 

Excel actually expects a Tab delimiter by default, and you might notice that the Tab is also the default delimiter in the Array to Spreadsheet String VI and Write Delimited Spreadsheet VI.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 5
(1,483 Views)

Hi RTSLVU,

 


@RTSLVU wrote:
Um.. The delimiter expected in a Comma Separated Values (.csv) file is a comma.

 

Excel actually expects a Tab delimiter by default, and you might notice that the Tab is also the default delimiter in the Array to Spreadsheet String VI and Write Delimited Spreadsheet VI.


On a German Windows with default German regional settings Excel expects semicolon as delimiter with numbers using comma as decimal separator char…

(Yes, I know what CSV means, but reality is different than expectations. When using a tab as delimiter I usually use ".txt" as file suffix for spreadsheet files, which Excel then also accepts gracefully.)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 5
(1,474 Views)