LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convert 1D array to 2D array

Solved!
Go to solution

Hello everyone,

 

In this topic http://forums.ni.com/t5/LabVIEW/Find-position/td-p/2059690 I have create a 1D array of string.

But no I would like convert this 1D array of string to 2D array of string.

I have try a for loop with inside a Build Array but in output it's a 1D ...

Do you have any idea?

 

Thanks

0 Kudos
Message 1 of 12
(10,900 Views)

I have try too a same idea of "read from spreadheet file.vi" because for my 2D array I would like \t for delimiter.

0 Kudos
Message 2 of 12
(10,898 Views)

@kourte wrote:

Hello everyone,

 

In this topic http://forums.ni.com/t5/LabVIEW/Find-position/td-p/2059690 I have create a 1D array of string.

But no I would like convert this 1D array of string to 2D array of string.

I have try a for loop with inside a Build Array but in output it's a 1D ...

Do you have any idea?

 

Thanks


Already answered in your original post.

 

For others: Build Array.

 

 


I have try too a same idea of "read from spreadheet file.vi" because for my 2D array I would like \t for delimiter.

I have no idea what you are saying here. Is this a question, or a follow-up comment?

0 Kudos
Message 3 of 12
(10,888 Views)

Hi,

 

You can use Build Array (array pallete) to convert the 1D array to 2-D. You'll have to remember to wire an array constant (string in this case) to the second input of the Build Array VI.

 

-CC

 

[Edit: sorry for the repeated info here - didn't see Smercurio's post until after I'd written mine]

----------------------------------------------------------------------------------------------------------------------------
"If anyone needs me, I'll be in the Angry Dome!"


0 Kudos
Message 4 of 12
(10,886 Views)

@ChrissyC87 wrote:

You can use Build Array (array pallete) to convert the 1D array to 2-D. You'll have to remember to wire an array constant (string in this case) to the second input of the Build Array VI.


No you don't.  You can resize the node to 1 input.


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 12
(10,877 Views)

@crossrulz wrote:

No you don't.  You can resize the node to 1 input.


Every day is a school day!

 

-CC

----------------------------------------------------------------------------------------------------------------------------
"If anyone needs me, I'll be in the Angry Dome!"


0 Kudos
Message 6 of 12
(10,872 Views)

Hye everybody,

 

thanks for your answers but I would like a tab for delimiter with the 2D array.

0 Kudos
Message 7 of 12
(10,865 Views)

Just to clearify with an example:

You currently have:

    "a\tb\tc","d\te\tf"

and you want to convert to:

   "a","b","c"

   "d","e","f"

???


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 12
(10,862 Views)

Hye,

 

yes.

I have for example this 

06/11/2012\tCheckout\t...

and I would like the 2D array as in the  picture

0 Kudos
Message 9 of 12
(10,849 Views)

Hi kourte,

 

use SpreadsheetStringToArray to convert a single string. Use a FOR loop to convert an 1D array of strings, which will yield in a 2D array...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 12
(10,844 Views)