Score:0

Compare two files and remove every line that doesn't match with file B

eg flag

I have two files. file A:

Modern Tales: Age Of Invention Playstation 4, 1935, 3478-3480
Modern Tales: Age Of Invention Xbox One, 3074
Moero Chronicle Switch, 6667, 12400, 28910, 29900, 29901, 29920
MOHAA Counter Intelligence, 
MOHAA MatchWatch, 950, 5500-5699, 13000-14000
MOHAA Missionary, 
Mokoko X Switch, 6667, 12400, 28910, 29900, 29901, 29920
Mokoko X Xbox One, 3074

and file B:

MIX Game Server
MOHAA Counter Intelligence
MOHAA MatchWatch
MOHAA Missionary
MOHAA Reverend
MoneyWorks Datacentre
Monsoon Vulkano
Moonlight Game Streaming
MY-IPCAM Anywhere

How can I remove every line from file A that doesn't match in file b. Final file should be:

MOHAA Counter Intelligence, 
MOHAA MatchWatch, 950, 5500-5699, 13000-14000
MOHAA Missionary, 
Score:2
tn flag

Like this:

$ grep -f file_b file_a
MOHAA Counter Intelligence, 
MOHAA MatchWatch, 950, 5500-5699, 13000-14000
MOHAA Missionary, 
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.