LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Jumps a row in append to file with Write to spread sheet

Greetings,
 
I am using Labview 8.2.1 to write a one dimensional array of strings to a csv file with "Write to spreadsheet vi" after every test. I have set the "Append to file" to True so that the data is appended to the existing file. It does so correctly except that when it writes, it jumps one row on the spreadsheet. Could anyone help why the vi jumps one row instead of appending the data to the immediate empty row?
 
Regards,
 
A Novice
0 Kudos
Message 1 of 7
(3,313 Views)

Attaching your vi and/or data will ultimately help us help you faster...

Does your data happen to start with an empty row, leading to an appended empty row every time?

0 Kudos
Message 2 of 7
(3,310 Views)

I agree, the code would help to solve this problem.  One thing to look at:

When you open the file check where the EOF(End of file) tag is.  You can do this by opening the file as a text and see where the blinking curcor stops at the end of the data.  If it is on the empty line below your last row, then you are writing an unnecessary EOF character.

If the EOF is on the last row of your data, then you are appending an EOF before you write the new data.

 

Tom

0 Kudos
Message 3 of 7
(3,304 Views)

Greetings

Initially, I am emptying the Global variable that holds the data as shown in the attachment. Then writting from the Global values into the spread sheet as shown following the initialization. I have attached a word document displaying the code.

 

Regards,

 

 

 

0 Kudos
Message 4 of 7
(3,296 Views)
I'm not sure because there still is not enough info.  But, it looks like the added row is occurring when you write the data.  I tested just the write function and it did not have an extra line between the rows.  so maybe you are calling the function to write the data and then calling again after you clear the global.

Message Edited by Tom Haggerty on 10-09-2007 03:30 PM

Message Edited by Tom Haggerty on 10-09-2007 03:32 PM

0 Kudos
Message 5 of 7
(3,288 Views)
The function "Write to spreadsheet file" adds the EOL character so if you are adding one to the end of your string array that could also cause this problem.
0 Kudos
Message 6 of 7
(3,279 Views)
Greetings,
 
I have discovered why I was getting the extra space, thanks for your hints.
 
The instrument, Infiniium oscilloscope, from which I was reading the data was adding a new line at the end of the data,i.e. \n. Just adding "Trim white space" before putting the data to the Global variables solved my problems. Thank your for your help.
 
Cheers!
 
A Novice
0 Kudos
Message 7 of 7
(3,261 Views)