11-20-2019 12:14 PM
I am trying to concatenate then convert 1D arrays of floats to a csv string. The array needs to be a fixed size.
When the incoming array is less than the fixed size, I would like the value to be an empty string, so 1,2,3 would come out as "1,2,3,,,,,,,,,,,".
The 'Reshape Array' VI zero pads the array however. Is there an easier way to do this?
Solved! Go to Solution.
11-20-2019 12:27 PM - edited 11-20-2019 01:09 PM
Format first, then pad the string array with empty strings using reshape array.
(fixed size is 8 elements each in this example)
11-20-2019 12:28 PM
That's the wrong function. Why use Reshape Array?
The correct function would be Array Subset.
11-20-2019 12:29 PM
@RavensFan wrote:
That's the wrong function. Why use Reshape Array?
The correct function would be Array Subset.
Reshape array can pad or trim. Array subset can only trim.
11-20-2019 12:35 PM
I missed the part that they wanted empty strings. I was only seeing the problem about 0's coming from the reshape array when the array was too short.
11-20-2019 12:51 PM
Taking advantage of the fact that the default value of a string array for reshape array is an empty string. Thanks altenbach.