LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Spreadsheet formatting

Ok i'll give that a try. 🙂
Aquaphire

---USING LABVIEW 6.1---
0 Kudos
Message 11 of 13
(535 Views)
Also remember that what you are writing is not a microsoft excel file at all and giving it an *.xls extension does not change that fact. Extension *.xls is reserved for the proprietary microsoft format and should not really be used for plain ASCII files as you do here. (Open your file and a real excel file both in notepad, you'll see the difference ;))

Fortunately, excel is forgiving enough to automatically try its best to read any oddly formatted file having an .xls extension and tries to make sense of it. Don't count on the results to be always as expected.

I would recommend to give a better extension. For example you could separate your fields with commas and write it as *.csv file (that's what it now really is!). By default, *.csv files also open with excel, except in this case excel knows what it is supposed to be. 🙂

(You can write genuine xls files in LabVIEW, but it is a bit more complicated. Search for excel in your example browser for some tips.)
0 Kudos
Message 12 of 13
(521 Views)
The problem with adding a column each time you get a new datapoint is that the entries into the first rows need to be put into the "middle" of the file. It is easy to add a row to the file because it gets appended to the end of the file.

One option is to read in the file, locate the end of each row, insert the new data, and rewrite the file. This may get very slow if the file grows to a significant size.

Option 2: Keep all the data in memory and write to the file after all data collection is complete. Allows complete flexibility in how you format the data but runs the risk of data loss in the event of a power failure before the end of the run.

Option 3: Write the data in rows: Date:6/29/05 \t Time:10:56 \t 4.38857456 \r. Then after all the data has been recorded, read in the entire file, reformat it and write it out again. This saves data every time the Record button is pushed without manipulating the entire file each time and still lets you deliver the final result in the desired format.

Lynn
0 Kudos
Message 13 of 13
(519 Views)