01-09-2013 02:20 AM
I am trying to write dummy data to excel file and notice that there are blank cells in the file like below. How could I prevent this?
| 10:10:07 | 10 | 0 | 1 | 2 | 3 | 4 |
| 10:10:07 | 20 | 0 | 1 | 2 | 3 | 4 |
| 10:10:07 | 30 | 0 | 1 | 2 | 3 | 4 |
| 10:10:07 | 40 | 0 | 1 | 2 | 3 | 4 |
| 10:10:07 | 50 | 0 | 1 | 2 | 3 | 4 |
| 10:10:07 | 10 | 0 | 1 | 2 | 3 | 4 |
| 10:10:07 | 20 | 0 | 1 | 2 | 3 | 4 |
| 10:10:07 | 30 | 0 | 1 | 2 | 3 | 4 |
| 10:10:07 | 40 | 0 | 1 | 2 | 3 | 4 |
| 10:10:07 | 50 | 0 | 1 | 2 | 3 | 4 |
Solved! Go to Solution.
01-09-2013 02:23 AM
Which one you are calling as Blank cell? I don't see anything, also the code and the file you have shown matches. Please explain the exact problem
01-09-2013 02:44 AM
Yes I got it. You mean to say the empty row, you can clear that by inserting Trim Whitespace.vi at the output of the Array to Spreadsheet string primitive.
01-09-2013 02:52 AM - edited 01-09-2013 02:59 AM
Thank you for your answer. But is there another way to do it? Because this function is only accept string inputs instead of arrays both 1D and 2D so I need to use it after all my string before the build array function. It is too time consuming for large data sets.
Edit: Sorry I did not understand your suggestion in the correct way. I opened the write to spreadsheet function and add this trim function in the place that you pointed but it does not affect the file.
01-09-2013 02:59 AM
Did you do this way?
01-09-2013 03:08 AM
Ohh... I placed it in the wrong way. IAll blank rows are dissapeared after this modification. Does only this section cause the blank rows and why?
01-09-2013 03:21 AM
You can check the help file of the Array to Spreadsheet string function, it shows always a EOL (End-of-Line) character will be added to seperate the rows. You had two because you are using one and the write to spreadsheet vi uses one.
01-09-2013 06:24 AM
I have also another problem about leaving rows in spreadsheet blanks. I tried to explain what the problem is in the attachment. Could you help me on this?
01-09-2013 07:33 AM
An empty array will not produce any output.
If you want to generate a zero-filled table you need to create an array with as many elements as needed, using for example the Initialize Array function.
01-09-2013 07:57 AM
Oh right. I have forgotten to fill it. Thanks 😄