Alright, I'm working in a few hundred lines of code here that would take exponentially longer to sanitize and create data sets to provide a functional snippet....so I'm not going to. I think the question is easy enough to pose, so I'm hoping I don't get too many "follow all the rules" replies.
I have two arrays. Array one is the finished product of the script.....except it has a ton of extraneous data that I don't want, and has proven incredibly hard to prevent from being entered into the array. Enter array two, my filter.
Array_1 [0] = master_id [1] = sub_id1 [2] = sub_id2 [3] = sub_id3 [4] = sub_id4 Array_2 [0] = data [1] = sub_id
What I need to do is take Array 1 and recreate it for [ 0 ],[ 1 ],[ 2 ],[ 3 ],[ 4 ] for each entry where [ 1 ] or [ 3 ] matches any of the [ 1 ]'s in Array 2
is that straightforward enough? Sorry for the crap post, I'm on a time crunch and traveling away from my notes on this script. Brain is fried.
OOOOH, and while we're at it, lets add a [ 5 ] and [ 6 ] to array 1 that stores any matching [ 0 ] from array 2 for that sub_id!
final filtered output if sub_id1 or sub_id3 exist in array 2: Array_3 [0] = master_id [1] = sub_id1 [2] = sub_id2 [3] = sub_id3 [4] = sub_id4 [5] = sub_id1_data [6] = sub_id2_data
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |