LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

writing to spreadsheet file

Hi All!

I am trying to write some data to a file, using the spreadsheet format. I am writing 3 values to the file every now and then. I have a dummy piece of code to do it, which i attach herewith, however when i write to the file, the 1st line seems fine, but subsequent lines have an extra blank space before the 1st actual value and that causes the reading into a table to get messed up.

Please advise!

Thanks.
Regards,
0 Kudos
Message 1 of 6
(3,670 Views)
The blank space at the beginning of the second line is there because the Array to Spreadsheet String VI sees the carriage return as a character, then inserts a tab, and then continues to insert the values. I've attached what I think you want to do, although I don't think this is a very efficient way because of all the build arrays. It really depends on what you ultimately want to do in your application, so if you're going to have a lot of those values written like that, you should initialize an array and replace values into it.
0 Kudos
Message 2 of 6
(3,663 Views)
Errrr... why don't you just use the "Write to Spreadsheet File" function? Smiley Wink
0 Kudos
Message 3 of 6
(3,653 Views)
Hi there!

Thanks for your responses. From what i understand, the write to spreadsheet file vi is used only 2 write numeric values to the file. However, i wish to write date/time values also!
I could write the "long" value for the date and time to file, then i'm sure it would work, but then it becomes undreadable to people!

Please advise.

Thanks
Regards,

0 Kudos
Message 4 of 6
(3,629 Views)

You can save your own version of the write to spreadsheet vi and make it usable for string intputs! 🙂 Double-click the VI and read the comments inside it for info. All you need to do is replace a couple controls. Just make sure to save a COPY of the VI and not over the original! That way you'll be able to save the date/time as a string...

Come to think of it, are you saving waveform values? There is also an Export waveform to spreadsheet VI, which is pretty handy. Check that out too. This way you wouldn't have to convert, or prettify the format of the date/time.

0 Kudos
Message 5 of 6
(3,614 Views)
Hi,
 
See if the method followed in this vi helps you
 
Modify it to suit your purpose
 
Regards,
Dev
0 Kudos
Message 6 of 6
(3,612 Views)