LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Output

Solved!
Go to solution

Hi all!

I have one 1D array of string and two 1D arrays of doublee. 

I need to export it in excel or in a txt file.

in the first column i want the array of string and the two arrays of double in the adjacent columns.

0 Kudos
Message 1 of 11
(2,369 Views)

You will need to format your 2D array of doubles into strings.

Then place the 1-D array of strings ahead of it.

If you do it with Build Array, you'll need to do a transpose of the 2-D array before and after.

Or you could do it in a loop so it appends an element of the string array to a row of the 2-D array (auto-index both tunnels) and it will do it row by row.

0 Kudos
Message 2 of 11
(2,363 Views)

And where is the problem?

 

What you want is pretty basic (did you do the courses?), but without knowing where you fail, it's going to be either more lengthy than needed, or so generic it won't help much.

 

Convert the numeric arrays to text.

Build a 2D array.

Either write to file in a double loop, or

Convert to string (2D Array to Spreadsheet String) and write it to file.

 

(Pretty much infinite) variations are possible...

0 Kudos
Message 3 of 11
(2,362 Views)

I tried but there are allways problems. 

someone can help me showing me the block diagram?


the first column has to be the array "filenames" the second has to be "array min" and the last "array max".

0 Kudos
Message 4 of 11
(2,309 Views)

@Gquadro wrote:

I tried but there are always problems.


Then show what you have tried and tell us what is wrong with it.  We are much more likely to help you debug than to just give you code and you learn nothing.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 11
(2,302 Views)

@Gquadro wrote:

I tried but there are allways problems. 

someone can help me showing me the block diagram?


Not sure if it's 'the' block diagram, but it does what you described:

Simple File.png

Like I said, there are tons of variations, and the best fit will depend on requirement details...

0 Kudos
Message 6 of 11
(2,269 Views)

Gquadro_0-1581513848852.png

this is what I tried but I obtain all the informations in one cell...

0 Kudos
Message 7 of 11
(2,256 Views)
Solution
Accepted by topic author Gquadro

Your format string makes little sense.  If you are saving a text document that will be understood by Excel, then you need a tab between each of your columns.  I am seeing you trying a literal '\' followed by a 't' and then spaces.  Change your format string to be "%s\t%f\t%f\n".  This will format a string, followed by a tab, a floating point number, followed by a tab, another floating point number, and finally a Line Feed character.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 11
(2,249 Views)

And how can I do to to change row?

I want to obtain something like this:

String1;Double1of the first array;Double1 of the second array

String2;Double2of the first array;Double2 of the second array

0 Kudos
Message 9 of 11
(2,245 Views)

@Gquadro wrote:

And how can I do to to change row?

I want to obtain something like this:

String1;Double1of the first array;Double1 of the second array

String2;Double2of the first array;Double2 of the second array


That is hard to advice on without knowing exactly what is wrong. The code that you show does exactly what you programmed it to do. Apparently that doesn't match what you require it to do, so what (exactly) is the current problem.

 

What is 'the first array' and what is 'the second array'? The wires cross each other and are all over the place.

 

What is the result you are getting now? Note that we don't know what the data is that you feed into the algorithm.

 

Rotating an array with the size of the array is a no-op.

 

Wiring the "N" of the for loop doesn't do anything. Auto indexing will automatically determine the nr. of iterations. This makes me think the problem is in the array sizes though. Are the file array, 1st array and 2nd array the same size? If not, the for loop will loop smallest size. If you don't want that, specify what you do want.

0 Kudos
Message 10 of 11
(2,237 Views)