From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
05-08-2020 02:40 AM
Hi,
Greetings.
I have two 1D arrays and I have a 2D array
first array - { a,b,c,d,e}
second array - {a,b,z,c,d,e}.
2D array -{name, vendor, type,number
abc, efg , a , 6,
aaa, rrrr, b, 7,
zzz, tttt, c, 6}
I want to pull out that element that is additional in the second array and insert it into 2D array under the type column in the last row. I am not able to find a solution. it would be of great help if anyone helps me in finding a solution.
Thanks in advance!
have a good you'all:)
05-08-2020 04:05 AM
The adding to the 2Darray can be done in a dozen ways. It's not clear to me what exactly should be added, so this solution is just a general one that works.
05-08-2020 04:41 AM
Thank you so much for the reply:)
The z element which is present in the second array should be added to the type column leaving other columns blank.
name vendo type numb
aaa bbb a 6
cccc rrr b 7
eee zzz c 8
www qqq d 5
uuu iiii e 9
z
similar to this I have again 2 - 1D array so I should search in the similar manner and find that additional element and add it to the 2D array
name vendo type numb
aaa bbb a 6
cccc rrr b 7
eee zzz c 8
www qqq d 5
uuu iiii e 9
new-element z
05-08-2020 06:48 AM
@DeepJames wrote:
The z element which is present in the second array should be added to the type column leaving other columns blank.
Simply remove the "??" from the string, you'll get empty strings.
If the input array has the data (I only copied the titles), what I've posted does this.
@DeepJames wrote:similar to this I have again 2 - 1D array so I should search in the similar manner and find that additional element and add it to the 2D array
name vendo type numb
aaa bbb a 6
cccc rrr b 7
eee zzz c 8
www qqq d 5
uuu iiii e 9
new-element z
Not sure what you mean.
You also have 1D arrays for the name column? I'd hope the added element in that array has the same index as in the type array. So you can simply use the index to get the new name: