#!/usr/bin/perl -w #use strict; $file1= "StatusRegs.txt"; $file2 = "RegsUNQ.txt"; open (ONE, $file1) or die "Couldn't open $file1: $!\n"; open (TWO, $file2) or die "Couldn't open $file2: $!\n"; while ($line1 = <ONE>) { $line2 = <TWO>; if ($line1 ne $line2) { print "$line1 does not equal $line2 at line $.\n"; } else { print "$line1 is the same in both files at line $.\n"; } }
In reply to Comparing 2 files without diff or compare by ilottl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |