LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

unexpected blank cells in the spreadsheet file after writing

Solved!
Go to solution

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
Egemen
0 Kudos
Message 1 of 10
(4,374 Views)

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

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 10
(4,373 Views)

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.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 3 of 10
(4,364 Views)

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.

Egemen
0 Kudos
Message 4 of 10
(4,361 Views)
Solution
Accepted by newbieeng

Did you do this way?

 

Trim WhiteSpace.png

-----

The best solution is the one you find it by yourself
0 Kudos
Message 5 of 10
(4,357 Views)

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?

Egemen
0 Kudos
Message 6 of 10
(4,351 Views)

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.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 7 of 10
(4,346 Views)

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?

Egemen
0 Kudos
Message 8 of 10
(4,326 Views)

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.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 9 of 10
(4,308 Views)

Oh right. I have forgotten to fill it. Thanks 😄

Egemen
0 Kudos
Message 10 of 10
(4,302 Views)