From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, 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: 

How to write header strings for a spreadsheet data file

I have data I am writing to a spreadsheet file. I was wondering how to also write strings to the spreadsheet file so the top of each spreadsheet column has the title of the data it is representing.
Message 1 of 9
(18,420 Views)
You call File Write.vi multiple times for that. Attached VI would give you idea.

A Rafiq
National Instruments
http://www.ni.com/ask
Message 2 of 9
(18,420 Views)
Is there any way to do this using the Write to Spreadsheet.vi? Also, I need some explanation for the file you sent. I'm not sure why you need a refnum the way you have it hooked up. I already know the exact path to the file where I want to write the column headings, so how does that change the diagram in the file you attached?
0 Kudos
Message 3 of 9
(18,420 Views)
You can write strings to a spreadsheet. For that:
-Make a copy of write to spreadsheet
-Change the input numerical controls with string controls
-Now you have a vi that will accept string arrays

If you first use the modified vi to write headers and next you use write to spreadsheet to write data(making append to file TRUE) you'll have what you want.
Hope this helps
0 Kudos
Message 4 of 9
(18,420 Views)
Hi Marci,
I modified the Write to Spradsheet File.vi to add column headers.
They are inserted in a string array, I also create a terminal in the connector pane so that you can use this vi in your application.

Good luck,
Alberto
Message 5 of 9
(18,420 Views)

Hi

 

I tried the method you specified but the problem is, the header files are getting created every time the loop is running. Is there a method to write the headers only in the beginning?

0 Kudos
Message 6 of 9
(17,310 Views)

I could solve it!!

 

For anyone referring to this post later, just keep the column header string in a case structure under true condition and wire the "first call" functions output to it. Leave the false case empty ans select "use default if unwired" by right clicking on the tunnel.

0 Kudos
Message 7 of 9
(17,309 Views)

Hallo Vijay ,

 

what is the "first call" functions ?. 

i have also the problem tat the input of the colkumn headers are vanished after every run although i save it 

0 Kudos
Message 8 of 9
(15,484 Views)

This thread is 12 years old and Vijay answered the question in 2011. And it doesn't seem that your question has something to do with the original. If you start a new thread you will have more visibility. But let's answer you, anyway.

 

A first call function detects if the loop is running for the first time. But your problems seems to be that you are losing your data after every loop, which means you can use a Shift Register to store the data to the next loop.

Also, what's the purpose of this stacked sequence structure? Please post your VI if you can.


Regards

Mondoni
0 Kudos
Message 9 of 9
(15,473 Views)