in reply to Filtering lines from one file from another
Hi, You can try this,
# open file1, fil2 ; open F1 , "$file1" or die "Cant open : $! \n" ; open F2 , "$file2" or die "Cant open : $! \n" ; # Create the hash key with each line of the file2 while (<F2> ) { chomp; $file{$_}=''; } # Print the line , if key does not exist in the hash ; while (<F1> ) { chomp ; print $_ , "\n" unless(exists ( $file{$_} ) ) ; }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Filtering lines from one file from another
by Limbic~Region (Chancellor) on Feb 03, 2011 at 16:21 UTC |
In Section
Seekers of Perl Wisdom