LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Converting from spreadshet string to array and then back to spreadsheet string

My questions is; why is the Spreadsheet string to array function creating more data than the original string had when you change the array back into a spreadsheet string. Im trying to analyze a comma delimited file using array functions since my column and row size is constant, but my data varies. Thus my reason for not using string parsing functions which would get more involved and difficult. So, however, after i convert to a 2D array of data from the comma delimited file I read from, and then I convert back to string using the Array to Spreadsheet String, I get added columns to the file, which prevents another program from receiving these files. Also, the data which I am reading is not all contiguous, it has gaps in some places for empty data. Looking at the file compared to the original after it has gone from string to array and then back to string again, looks almost identical except for the file size which got larger by 400 bytes and where the original file has empty spaces, the new file has a lot of commas added. Any idea?

Charles

0 Kudos
Message 1 of 2
(2,684 Views)
The result you get is normal when the spreadsheet string contains rows of uneven length. Since the array rows have the same number of elements, nil values are added during the coonversion. And of course, the back to string conversion keep those added values in the string, with the associated commas.
example : 3 x 3 array
1,2,3
4
5,6,7

is converted into
1 2 3
4 0 0
5 6 7

then back to
1,2,3
4,0,0
5,6,7
Chilly Charly    (aka CC)
0 Kudos
Message 2 of 2
(2,680 Views)