google sheets – using a list of ID’s and a List of conditions COPY and Paste

I have a spreadsheet a list of 15 spreadsheet that I have to update weekly with fresh data.

At present I do this manually however having a script will make the task so much easier.

What I have is a spreadsheet that contains the master data, with a separate tab that contains a list of the spreadsheet ID’s in Column A and a list of the filter condition that corresponds to that ID in column B.

What I want to do is have a script that filters my master sheet using the condition in Column B on sheet2 then pastes that information into sheet1 of the spreadsheet ID located in Column A of sheet2.