LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Save Data to Txt or CSC in Columns and add Comments

Hello,

 

currently i m Excel Files for my File I/O like in the attached VI. 

To get a better access for people without Ecxel i wanna chance the Date Save system to CSV or txt.

How can i save date to a CSV or TXT file with also having columns. Up site on every column should stand the Datatype (like Voltage, Power...). My Data type are numeric Data, daynamic Data and String (i want to add a comment, so i can better order all my Measurements)

 

Regards

Felix 

0 Kudos
Message 1 of 4
(855 Views)

Hi Felix,

 


@felixflex wrote:

How can i save date to a CSV or TXT file with also having columns. Up site on every column should stand the Datatype (like Voltage, Power...). My Data type are numeric Data, daynamic Data and String


To have columns in a CSV file you need to insert delimiter chars. Typically you use commas (as CSV = Comma Separated Values), but in Germany (by default) you should use a semicolon instead… (WriteDelimitedFile will do that for you.)

To save different datatypes you should convert them all to string and create a string array to use WriteDelimitedFile.

Best regards,
GerdW


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

Hallo GerdW,

 

thanks for your help.

I tried to convert my diffent data into String, but i dont understand how i can handle the nummeric measurement Array Data.

 

Step by Step: 

1. i created a String Array with the names of the diffrent Data types.

2. i use WriteDelimitedFile to write the Data names as headline

3. i convert the nummeric data via "Format to String" to a string

4. i convert the nummeric Array vie "Array to Spreadsheet string" to a sting

5. i build a String Array

6. i use WriteDelimitedFile again to write the data under the headlines

 

But my converted nummeric array data is than not placed in the column under the right headline.

 

0 Kudos
Message 3 of 4
(792 Views)

Hey GerdW,

 

thanks for your help.

 

i dont understand how i get a nummeric Array into a String, so that the Data get saved in a Column under the headline.

 

A other problem i have is, how to safe more Measurements in one TXT.

The best for me would be that when i open the LAB View Programm, it creat with the first measurement a TXT File. In the first row i save the fixed headlines for the different data. Then, every time i do a measurement the new data get safed under the last measurement..

 

 

 

0 Kudos
Message 4 of 4
(802 Views)