while ( lines_to_read() ) { if ( the_line_is_the_right_header()) { if ( the_line_also_has_impressions) { # impression things } } }