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: 

Spreadsheets in LabView

I have a couple of issues regarding spreadsheets.

 

When i save the the data to Excel i want to label the columns, I used concatenate string and then the Write Characters to File.vi but when i open the spreadsheet i don't see the label for the columns.My other issuse is the following: I have 3 seperate excel files for Magnitude, Phase and Frequency. Is there anyway i could have combined all 3 of those to 1 excel spreadsheet in 3 seperate columns?

 

Thank you

0 Kudos
Message 1 of 5
(2,487 Views)

First, you are not saving to Excel if you are using the Write Characters to File. That writes to simple text files. I'm guessing that you are using the Write to Spreadsheet File and using a .xls externsion. Again, that is a text file that Excel can automatically open.

 

You did not post any code but if you are using the Write to Spreadsheet after, my guess is that you did not set the Append to File input to True. Left unwired, it defaults to false and you would overwrite anything you had previously done.

 

Again, with seeing your code, I am guessing but if you have separate arrays for each, just combine them with the Build Array function to get a 2D array.

0 Kudos
Message 2 of 5
(2,474 Views)

@arthur51189 wrote:

[...]  want to label the columns [...] when i open the spreadsheet i don't see the label for the columns [...] 


 

 

Do you have a routine in the beginning of the program that writes a "header", i.e. the labels for the columns?. If not, you should do that, and as Dennis said, set the Append to True.

 

Secondly, writing three values is cake: Just get the three values and convert to string and concatenate with Tab constants between them, with a Carriage Return as the last character, and write this one-line string to the file. You can use a single element Build Array to convert the string to an array if you want to use Write To Spreadsheet File, which does more work for you than Write Characters to File.

 

 

 

Richard






0 Kudos
Message 3 of 5
(2,466 Views)

I'm using the Write Characters to File.vi and connecting that to the Write to a Spreadsheet.vi. I don't think there is a way to directly connect the concatenate string to the Write to a Spreadsheet.vi thats why I'm using the the Write Characters to file.vi? When you mentioned earlier about the Append to file to put it to True, was that one the Write to a Spreadsheet of Write Characters to File?

 

Thank You.

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

i got it guys thanks a lot for the help

0 Kudos
Message 5 of 5
(2,442 Views)