#!/usr/bin/perl use strict; use warnings; my @dump; my $false_count = 0; open (FH, "<file_name") || die "Cant open : $!"; while (<FH>){ if (/^.\|TOTAL.*$/i){ my @tmp = $_ =~ /([0-9\.\-]+)/g; push @dump, "@tmp"; }else{ $false_count++; } } print 'Counted matches-> '.$#dump."\tUnmatched lines-> ".$false_count. +"\n"; foreach (@dump){print $_."\n";}
In reply to Re: Extracting string from a file
by builat
in thread Extracting string from a file
by Bindo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |