in reply to extract trailer count one liner

And if the file is large, seek() relative to the end of file before you start to read. Say the known max-length of a trailer plus 50 bytes. Then read lines until you find one that matches the trailer regex.