in reply to Re^5: Loop problem: jumps one record
in thread Loop problem: jumps one record

poj,
same table but with different criteria.

Replies are listed 'Best First'.
Re^7: Loop problem: jumps one record
by poj (Abbot) on Jan 31, 2017 at 13:22 UTC

    Ok, since you didn't detail the criteria you need to adapt this as required

    #!perl use warnings; use strict; my $criteria; while (<>) { next unless /\S/; # skip blank lines if (/(Relay access denied|blocked using)/){ $criteria = $1; next; } if (/\d+\s+(\S+)/ && defined $criteria){ print "update db $criteria = $1\n"; } else { $criteria = undef; } }
    poj