I have a 2 column Main Array with a string of specific numbers in each column. The Main Array is very long > 100,000 rows. I need to remove specific rows from this Main Array. The specific rows I need to remove are in a "Bad" Array with about 200 rows. The "Bad Array" also contains 2 columns. So if a specific Column A, Column B element from Bad Array match the same specific Column A, Column B element from Main Array, then that row needs to be deleted from the Main Array. That's one part of it. But there is a second part. The code also needs to compare that same row in the Bad Array but this time Column B, Column A against the Main Array and if there is a match then delete that row wherever it exists from the Main Array as well. There should be 2 deletions in the Main Array for each row in the Bad Array. Column A, Column B Deletion....and Column B, Column A Deletion
For example...
My Main Array
123124, 255643
845814, 584894
845814, 684948
203049, 483949
346446, 694506
904392, 494078
293938, 636320
684948, 845814
636320, 293398
Bad Array with Rows that need to be removed from the main array
845814, 684948
293398, 636320
My code needs to delete from the Main Array...
845814, 684948
684948, 845814
293398, 636320
636320, 233398
Ultimately resulting in a final Main Array that looks like this...
Final Main Array
123124, 255643
845814, 584894
203049, 483949
346446, 694506
904392, 494078
I am not great at coding. I wasn't sure whether to "walk" down the Main Array or the Bad Array. My hope is that experienced programmers have seen this before and might have some code that can help me. I hope my explanation was clear. Thank you very much for your help.
Bookmarks