LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

upgrading help - convert 1D array of string to 1D array of single number error?

i'm confused. what exactly is the difference btw an output as a spreadsheet file and as a text file? are you saying don't use the
"write to spreadheet file"? sorry, this is my first experience with lv
0 Kudos
Message 11 of 26
(1,139 Views)

You can open the "write to spreadsheet file" and you can see that all it basically does is use "array to spreadsheet string" the write the resulting string to the file. You can do that yourself if you have a more complex situation! 🙂

In LabVIEW, a "spreadheet" is nothing more than an ASCII formatted table with columns separated by tabs (by default) and rown separated by linefeeds. It has nothing to to with any proprietary binary format such as excel.

0 Kudos
Message 12 of 26
(1,135 Views)
alright i understand the difference a little better. the "write to spreadsheet file" seems to be a lot more complicated than just the write to text (look at attachment) so you sure i don't need to use the "write to spreadheet file"?
0 Kudos
Message 13 of 26
(1,129 Views)
No, because you don't need all that extra functionality. For example, you can transpose the 2D array directly if you need to.
 
The rest is just opening the file, writing the string and closing the file. Nothing magical. 😉
0 Kudos
Message 14 of 26
(1,116 Views)
sooo...this is good? maybe? hopefully? top one is the changed re-editted version

Message Edited by unknown00 on 06-04-2007 03:51 PM

0 Kudos
Message 15 of 26
(1,116 Views)

No, it's not good!

Since there is no data dependency between the two file writes, there is no way to tell which one occurs first. LabVIEW is dataflow driven and does not necessarily execute left-to-right.

For a quick fix you could wire the error-out of the one that should happen first to the error-in of the second. This ensures data dependncy and the second one cannot start until it recevied data on the error wire, which can only happen when the first instance finishes.

Why don't you concatenate the two strings and use only a single file operation as in my earlier suggestion?

Other comment:. Assuming that the top array in the cluster is the same for all array elements, you can probably delete the "index array" and disable indexing at the output tunnel of  of the upper array leaving the FOR loop. (If the top arrays differ, a lot of the code would not make sense because you would be throwing away most of the data)

Message Edited by altenbach on 06-04-2007 02:10 PM

0 Kudos
Message 16 of 26
(1,111 Views)
how about this? top is editted version

also, i didn't get rid of the "index array" because i am not the original coder and my job is not to mess around with the code that much. but if, while testing, anything occurs, i will keep it in mind. thanks for your continuous help btw
0 Kudos
Message 17 of 26
(1,092 Views)

I would flip the inputs to the "concatenate strings" It seems more likely that the column headers should be written first.

How does the output look like if you run it?

0 Kudos
Message 18 of 26
(1,081 Views)
yea i noticed that and switched them around quickly. output kind of works. the left side is how it's suppose to be in 2 columns so i can easily import that into another program and graph it. but instead now it displays it as 2 rows so there are like 1000+ columns which is messed up 😞 any ideas?
0 Kudos
Message 19 of 26
(1,079 Views)
Try this:
Just transpose the 2D array before the "array to spreasheet" operation. Transpose is in the array palette.
0 Kudos
Message 20 of 26
(1,073 Views)