#!/usr/bin/perl open FH1, "F1.txt"; open FH2, "F2.txt"; my @f1= <FH1>; my @f2= <FH2>; for my $x(0..4) { for each($f1[$x1] eq $f2[$x2]) { print $f1[$x]; } } close(FH1); close(FH2); exit;
F1.txt name value n1 001 n2 002 n3 003 n4 004 F2.txt name value n5 005 n2 002 n3 003 n8 008
In reply to comparing contents of the file by Ms.Ranjan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |