Hi,
I'm very new to these forums. I was wondering if someone could help an AWK beginner with a pattern matching
an actor to his appearance in movies, which would be stored as records. Let's say we have a database of 4 movies and need
to pattern match and actor's name and return his name followed by the movies he has appeared in (in chronological order). In this case I would like to pattern match Jennifer Lawrence and create an output file that lists Jennifer Lawrence at the top followed by the names of movies she has appeared in by chronological order, each on separate lines (just an output file of 3 lines). Any help would be appreciated. Thank you!
Casablanca
WB 1942
Humphrey Bogart: Rick Blaine
Ingrid Bergman: Ilsa Lund
Paul Henreid: Victor Laszlo
Hunger Games
Lionsgate 2012
Jennifer Lawrence: Katniss Everdeen
Josh Hutcherson: Peeta Mellark
Liam Hemsworth: Gale Hawthorne
Like Crazy
Paramount 2011
Anton Yelchin: Jacob Helm
Felicity Jones: Anna Gardner
Jennifer Lawrence: Samantha
Raging Bull
United Artists 1980
Robert de Niro: Jake LaMotta
Joe Pesci: Joey LaMotta
Cathy Moriarty: Vickie Thailer
I'm very new to these forums. I was wondering if someone could help an AWK beginner with a pattern matching
an actor to his appearance in movies, which would be stored as records. Let's say we have a database of 4 movies and need
to pattern match and actor's name and return his name followed by the movies he has appeared in (in chronological order). In this case I would like to pattern match Jennifer Lawrence and create an output file that lists Jennifer Lawrence at the top followed by the names of movies she has appeared in by chronological order, each on separate lines (just an output file of 3 lines). Any help would be appreciated. Thank you!
Casablanca
WB 1942
Humphrey Bogart: Rick Blaine
Ingrid Bergman: Ilsa Lund
Paul Henreid: Victor Laszlo
Hunger Games
Lionsgate 2012
Jennifer Lawrence: Katniss Everdeen
Josh Hutcherson: Peeta Mellark
Liam Hemsworth: Gale Hawthorne
Like Crazy
Paramount 2011
Anton Yelchin: Jacob Helm
Felicity Jones: Anna Gardner
Jennifer Lawrence: Samantha
Raging Bull
United Artists 1980
Robert de Niro: Jake LaMotta
Joe Pesci: Joey LaMotta
Cathy Moriarty: Vickie Thailer