Question : How do I check if the the value of a column

Doing the following I get this output ---

grep "Inserted" s.log | head -1

WRT_8038 Inserted rows - Requested: 3          Applied: 3          Rejected: 0          Affected: 3

I want to check if Applied column is greater than 0 or not. Is it possible?

Answer : How do I check if the the value of a column

don't use perl in perl, it gets too complicated with n times escaping characters, use perl directly!

open(FILE,"/v/region/na/appl/phoenixfunding/etl/data/qa/SessLogs/$wf_log");
while(<FILE>) {
  chomp;
  next if $_ !~ /Inserted/; # loops until a line with 'Inserted' is found, simulates the 'grep';
  if ( /Applied: +(\d+)/ ) {
    if ( $1 ) {
      print "Yes, applied is greater than 0\n";
    }
    else {
      print "No, applied is 0\n";
    }
  }
  else {
    print "there's no applied field here\n";
  }
last; # this breaks the loop after the first loop, simulating the 'head -1'
}
close(FILE);
Random Solutions  
 
programming4us programming4us