in reply to ignore duplicates and show unique values between 2 text files
If you have TWO files, then you would do "++" on the first, and "--" on the second...
use strict; use warnings; my $file1 = <<FILE1; 261293 'snow > equipment' 261293 'snow > equipment > boots' 261293 'snow > equipment > facemasks' 261293 'snow > equipment > goggles' 261293 'snow > equipment > helmets' 261293 'surf > accessories > books' FILE1 my $file2 = <<FILE2; 261293 'snow > equipment' 261293 'snow > equipment > boots' 261293 'snow > equipment > facemasks' 261293 'snow > equipment > goggles' 261293 'surf > accessories > books' FILE2 my %uniq; $uniq{$_}++ for split /\n/, $file1; $uniq{$_}-- for split /\n/, $file2; print join "\n", grep { $uniq{$_} } keys %uniq; print "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: ignore duplicates and show unique values between 2 text files
by LanX (Saint) on Apr 29, 2013 at 19:14 UTC |