Re: help regarding Comparision of two lines
- From: yitzle@xxxxxxxxxxxxxxxxxxxxx (Yitzle)
- Date: Sat, 29 Sep 2007 20:59:50 -0400
#!/usr/bin/perl
use warnings;
use strict;
# Make sure we got a valid file in $ARGV[0]
die "Wrong usage\n" unless (defined $ARGV[0] and -f $ARGV[0]);
open my $FH, "< $ARGV[0]" or die "Can't open $ARGV[0] : $!\n"; # I
think it was #!...
my $count = 0;
my $linesPrinted = 0;
while (<$FH>) { # Count lines with this string and print the 6th line
with this string
$count++ if ( /puts$conCheckFail/);
if ( $count <= 6 and $linesPrinted <= 6 ) {
$linesPrinted++; # Count lines printed. Stop after 6
print;
}
}
.
- References:
- help regarding Comparision of two lines
- From: Raaki
- Re: help regarding Comparision of two lines
- From: Yitzle
- Re: help regarding Comparision of two lines
- From: Raaki
- help regarding Comparision of two lines
- Prev by Date: Re: Strange debugging question...
- Next by Date: Iterated Hash Names
- Previous by thread: Re: help regarding Comparision of two lines
- Next by thread: win32 serial port
- Index(es):
Relevant Pages
|