Instead, it is quite reasonable to assume that the OP was not born yesterday. Every significant
-delimited line of any interest within the file as presented contains an instantly-identifiable, regex-friendly pattern. Long before a man named Larry Wall decided that he could do
was solving pragmatic problems more-or-less exactly like this one. Translation of this concept into actual Perl source-code is left as an exercise to the reader, and s/he has about thirty years' worth of source-code to get ideas from.