LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

To create a .csv file and save it into Excel Using LabVIEW

I want to save 2d data in .csv file. How can I do it ? 

0 Kudos
Message 1 of 5
(3,534 Views)

Hi amiraltaf,

 

easy: check.png

Best regards,
GerdW


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

First, a csv (comma separated variable) formatted file is not an Excel file, although Excel can be used to display and edit one. 

 

There is, on the string functions palette, a function called "Array to Spreadsheet" that will format a data array into a string table. The default "delimiter" (commas in your instance) is the "tab" character, but this is selectable. Then you write the string to a file using the standard file functions. There is a reverse function that converts "spreadsheet" strings back to arrays of data on the same string palette.If you download/install the OpenG tools there are some additional, powerful string functions that can be used as well.

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 3 of 5
(3,524 Views)

One reason you (and many other) confuse "Delimited Spreadsheets" (and other .csv files) with "Excel" is if Excel is installed on your computer, Microsoft "high-jacks" the .csv extension and assigns it an Icon that looks like the icon for Excel.  Excel can open a .csv file, but so can Notepad (try it -- it's especially easy to read if the "horizontal separator" is a <tab> instead of a comma).

 

Bob Schor

0 Kudos
Message 4 of 5
(3,495 Views)

@Bob_Schor wrote:

it's especially easy to read if the "horizontal separator" is a <tab> instead of a comma


But then it isn't really a CSV.  I have ran into enough international issues that I no longer use CSV formats.  Just as Bob was alluding to, I use tab delimited text files (*.txt).  You can still open them in Excel if you want (right-click, Open With->Excel), but they read just as well in Notepad or UltraEdit.


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 5 of 5
(3,483 Views)