#!/usr/bin/perl use strict; use warnings; use Inline::Files; my %col2file1; #use better name! while (<FILE1>) { next if /^\s*$/; #skip blank lines my $col2 = (split /\|/, $_)[1]; $col2 =~ s/^\s*//; #delete leading spaces $col2 =~ s/\s*$//; #delete trailing spaces $col2file1{$col2} = 1; } while (<FILE2>) { next if /^\s*$/; #skip blank lines my $col3 = (split /\|/,$_)[2]; $col3 =~ s/^\s*//; #delete leading spaces $col3 =~ s/\s*$//; #delete trailing spaces print if $col2file1{$col3}; } #prints: "AE|A|D|| " __FILE1__ L| D L| C L| C __FILE2__ AE|A|D|| A|A|P| | A|A|P| | A|A|P| |
In reply to Re: Comparision Utility PERL
by Marshall
in thread Comparision Utility PERL
by vighneshmufc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |