LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Remove zero fill from 2D array

I am parsing out a bit of data and the near-end product is a 2D array with each column representing a data set.  However, each data set does not have the same length and labview fills in the "gaps" with zeroes.  Is there a way that I can create this 2D array without the zero fill, or possibly an easy way to remove the zeroes once they are there?  I would prefer to have a way to turn the zero fill off, as some of my data may end in a 0 and I dont want to get rid of it by mistake.

Cheers!
0 Kudos
Message 1 of 2
(3,672 Views)

You can not have a true 2D array and not have the sizes be the same.  Each column must have the same number of rows and each row must have the same number of columns.

To do what you are asking you would have to "simulate" it.  You could have a cluster of 1D arrays with each cluster element being a "column".  Probably the best option if your number of columns are known/deterministic.

Or, you could convert it to an 2D array of strings (each element is the string of the number) and have empty strings in the empty elements (do this if you are only viewing the array, not if you have to convert back to numbers again).

0 Kudos
Message 2 of 2
(3,656 Views)