LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can i combine an array of string and an array of integers ?

Solved!
Go to solution

i have an array of string data [to be used as header], and an array of multiple column integer vakues;i need them together in one file. 

Am not able to combine them so that i can write them into a single file.

Download All
0 Kudos
Message 1 of 19
(8,370 Views)

I am not sure why you are using a 3D array. For your need you can simply build the two 2D arrays, I guess your header is a 1D array.

-----

The best solution is the one you find it by yourself
Message 2 of 19
(8,363 Views)
Solution
Accepted by Mahisnair

There are a few ways you can do this.  What I recommend is:

  1. Open the file
  2. Use the Array to Spreadsheet String to turn your headers into a single string
  3. Write this to the file.
  4. Use the Array to Spreadsheet String to turn your numeric data into a single string
  5. Write this to the file.
  6. Close the file


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
Message 3 of 19
(8,359 Views)

I dnt understand why i get a 3D array at the output of "read from spreadsheet",  again..i am not able to combine the string data and integer data [indicator named " number" ]

0 Kudos
Message 4 of 19
(8,358 Views)

i will show you my original vi, i did as u said but the header part is over written by the integer data columns; i only get the integer columns in the text file written.

 

 

[Header string is extracted from input file, written to a file and then the integer values[after derieving them from the same input file] is written back into the file where i stored the header strings. ].

VI attached [jan 17 bulid_6]

Thank you.

0 Kudos
Message 5 of 19
(8,342 Views)

Attaching the vi as labview 8 compatible also, please help.

Thankyou.

0 Kudos
Message 6 of 19
(8,337 Views)

Of course your header is overwritten. You have the Write to Spreadsheet File set to create a new file when it is called.

Message 7 of 19
(8,326 Views)

thanks a lot for the reply, how can modify so than i can get both header and the rest of intger columns [below it] in the same file?

0 Kudos
Message 8 of 19
(8,322 Views)

A file is one long string of characters, nothing else. It is up to the program to interpret them in a meaningful way. Same for writing. Simply compose a string with all desired parts and delimiters and write them to a file.

Message 9 of 19
(8,317 Views)

Simply set Append to File to true with a Boolean constant. Having Context Help open at all times is highly recomended.

Message 10 of 19
(8,317 Views)