Jump to content

Comparing Two Arrays


Recommended Posts

Hi,

 

What I have is two different files with about 150 different elements each.  These files could have the same elements or could have different ones, so what I need to do is create an array which returns the elements which match from one array with the rest of the row in that array... It's difficult to explain but say these are the two files:

 

array 1                                                      array 2

A                    1                                        A

B                    2                                        B

C                    3                                        E

D                    4                                        F

E                    5                                        G

F                    6                                        H

G                   7

H                    8

 

 

I need a new Array which would be

 

array 3

A                 1

B                 2

E                 5

F                 6

G                7

H                 8

 

try3


I tried this, but what happens is that if, say there were 3 less elements in the second array than the first, my code causes it to take off the last 3 elements in the array instead of the three which were missing

Edited by seanscal
Link to comment
  • 4 years later...
  • 1 year later...

Sorry I have two excel files with a column of unique numbers respectively. The first column is complete and does not undergo changes, the second column appears to be with the same column but with a lower number of elements.

I converted the excel files into 2D arrays even if only the first column is the one compiled about 900 fields of numbers only

I should look for the array missing elements in the first column. I tried to adapt the "crossrulz" *.VI but I can't find the correct solution

example

ARRAY 1  COMPLETE          ARRAY 2                            RESULT

1                                                     1                                       -

2                                                     -                                        2

3                                                      3                                       -                                      
could you please help me?

 

Edited by Frank22
Link to comment
  • 4 weeks later...
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.