I've data which looks like this:
abc.com Hello World Ann
abc.com Hi there friend
def.com Hello Sam
def.com Hello Dan
abc.com Hello World Mary
The string B can contain varying text but I've extracted keywords from that string to map with the below array, (this is not exact match of the String B)
keywords=( ["Hello World"]="h1" ["Hello"]="h2" ["Hi there"]="h3" )
I want to generate output like this:
A Key Count
abc.com h1 2
abc.com h3 1
def.com h2 1
which contains the count of occurrences of the combinations and A and keywords array. I'm new to using shell scripts and unable to start with any logic. All ideas highly appreciated! Thanks