LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to save data ( string) into multiple columns instead in multiple rows

Hello Friends,

please suggest me how to save data into different columns. I have attached two figures to save data. In this vi, the data was saved in different rows (first one) but I want to save it in different columns (second one).

Developed vi is attached below for reference

I am a beginner in LabVIEW, so don't mind for any childish question.

Thank you

1.JPG

2.JPG

save_datad.png 

0 Kudos
Message 1 of 4
(3,488 Views)

Hi Rajesh,

 

did you read the help for that WriteDelimitedTextfile function? Especially for those boolean inputs of that function?

Did you understand their meaning?

Best regards,
GerdW


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

A Spreadsheet file is a text file, where rows are defined by lines of text (i.e. a <New Line> is inserted into the text string where the line ends) and columns are defined by delimiters (the LabVIEW default being a <tab>, another common delimiter being a comma, which matches the ".csv" extension, for "comma-separated values".

 

So to have your Rows become Columns, the easiest way is to have all the data in an array (which has rows and columns) and interchange the Rows and Columns.  This operation is called a "transpose", and there is an Array function, "Transpose 1D Array", that will do it.  Give it a try.

 

Bob Schor

0 Kudos
Message 3 of 4
(3,469 Views)

Hi Rajesh,

 


@Rajesh10 wrote:

2.JPG


The expected format is not possible by writing single columns - because of the reason explained by Bob.

Two options:

  • collect all data in a 2D array in a way you like and save that 2D array after the loop.
  • save the data of each iteration as a single row, with "cycle" text in column A and numeric data starting from column B…

Anyway: whis is basic array handling you should have learned by taking the Training resources offered for free. And it is basic knowledge about CSV file formatting…

Best regards,
GerdW


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