12-08-2017 04:27 PM
Why flatten the array? Why not simply Write to spreadsheet file? I guess the result is about the same, just a couple of unnessecary blocks.
/Y
12-08-2017 04:35 PM - edited 12-09-2017 11:20 AM
@Yamaeda wrote:
Why flatten the array? Why not simply Write to spreadsheet file? I guess the result is about the same, just a couple of unnessecary blocks.
Well, the flattened data is binary and thus much more efficient and predictable. However, I just noticed that the first write operation is set to "Convert EOL" (look at the icon!), which of course throws sand in the gears and will corrupt the binary data almost guaranteed! But yes, the 2D array could be written using the binary file IO's which include the flatten step internally. The current code is definitely flawed!
12-09-2017 05:54 AM
To sum up the issues:
1) absolutely all the code shown in the image can be put inside the false case of the structure without any runtime behaviour change, except maybe a possible side effect from calling the data retrieval VI.
2) As Altenbach already pointed out, the Flatten to String together with a write to Text File AND enabled convert EOL is definitely going to corrupt the binary data in the file. So the data may be more compact but totally useless to read back afterwards. Either save the data as spreadsheet file or use directly a Write Binary File which does the Flatten to Binary String internally too. With the sizes you mention, I don't think the saving in disk space is significant unless your application writes such files every second or faster.
12-11-2017 08:45 AM
@altenbach wrote:
@Yamaeda wrote:
Why flatten the array? Why not simply Write to spreadsheet file? I guess the result is about the same, just a couple of unnessecary blocks.
Well, the flattened data is binary and thus much more efficient and predictable. However, I just noticed that the first write operation is set to "Convert EOL" (look at the icon!), which of course throws sand in the gears and will corrupt the binary data almost guaranteed! But yes, the 2D array could be written using the binary file IO's which include the flatten step internally. The current code is definitely flawed!
I haven't looked into the Write spreadsheet array, but assumed it used some sort of Flatten inside. If so, it's a slight Rube to do the job yourself. 🙂 In this case it also introduces an error, as you point out.
/Y
12-11-2017 12:06 PM
Write spreadsheet does formatting, not flattening. Big difference. To do it yourself, you would use "array to spreadsheet string".
12-12-2017 11:09 AM
@dhaugen92 wrote:
...Do you get the same problem if you just write the file and don't zip it up.
oooh. I DID confuse it with 'replace array subset'...
Let me switch that and see what happens.
Haven't tried not zipping it... interesting proposal. If the first thing doesn't work, I'll try that too.
So... the answer is?
Curious,
Ben
12-12-2017 12:39 PM
once I replaced the subset instead of inserting
the problem went away.
i monitored the index values for row and column in 'array size' function
it was increasing before
with using 'replace array subset', it no longer is.
THAN YOU ALL