03-09-2019 04:44 PM - edited 03-09-2019 04:52 PM
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
Solved! Go to Solution.
03-09-2019 07:37 PM
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
03-12-2019 07:25 AM
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.
03-12-2019 10:55 AM
Nothing to do with your original problem, but you can make your conversions a bit simpler, less operations. See below:
mcduff
03-12-2019 11:26 AM
Nice, I could have done with that at the start. I have added some tags so that others can find it.
Ed
03-12-2019 11:31 AM
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