LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write to spreadsheet vi - how to control number of returns

Solved!
Go to solution

Using the write to spreadsheet vi in the attached program I always get data separated by a blank line, If I delete the returns on the last row of the target text file the next write is on the same line, demonstrating that the extra return is added after each write. Is there any way to control how many returns the write to spreadsheet vi adds to the data? If that is where the extra return is coming from?

Ed

0 Kudos
Message 1 of 6
(2,350 Views)

You are doing something wrong, and it is difficult to understand from the disorganized snippet you attached.

 

Try creating a simple VI where you create, say, an array of 5 random numbers and write them to a Delimited Spreadsheet.  Do this inside another For loop (so you generate multiple rows and columns) and see if it as the proper .csv format.  Attach the VI (please, not another Snippet) -- if you get extra blanks lines, then you are "doing something wrong" and with a simple VI, it should be easy to find and point out the problem (though you will probably find it yourself, leading to your fixing your original code yourself).

 

Bob Schor

Message 2 of 6
(2,317 Views)
Solution
Accepted by topic author EdHarris

Hi Bob,

Thanks, you convinced me to do a trial, I changed the order of the inputs to the Build array vi and found that the array to spreadsheet string vi was adding the unwanted return. I had read elsewhere that you can remove returns with a trim white space vi so put that in between them which solved the problem.

 

Message 3 of 6
(2,288 Views)
Solution
Accepted by topic author EdHarris

Nothing to do with your original problem, but you can make your conversions a bit simpler, less operations. See below:

 

 

Snap21.png

mcduff

Message 4 of 6
(2,274 Views)

Nice, I could have done with that at the start. I have added some tags so that others can find it.

Ed

0 Kudos
Message 5 of 6
(2,263 Views)

Glad to help. Note that those functions, along with your string conversion can handle arrays directly, not need to put in a loop like your example.

 

mcduff

0 Kudos
Message 6 of 6
(2,259 Views)