in reply to list lines not found in config (while+if)
#!/usr/bin/perl -w use strict; die "Usage fileReference File2Check >outfile" if @ARGV != 2; my ($fileRef, $file2Check) = @ARGV; open (REF, "<$fileRef") || die "unable to open $fileRef"; open (CHK, "<$file2Check") || die "unable to open $file2Check"; my %seen = map{chomp; $_ => 1 }(<REF>); print grep { my $token = (split /,/,$_)[0]; !$seen{$token} }(<CHK>); __END__ fileref: ab gh kl mn op file2check: ab, 1234 cd, 2343 ef, 1253 gh, 4543 ij, 2343 kl, 2453 mn, 4753 output: cd, 2343 ef, 1253 ij, 2343
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: list lines not found in config (while+if)
by GrandFather (Saint) on Apr 08, 2009 at 00:23 UTC | |
by Marshall (Canon) on Apr 08, 2009 at 02:48 UTC | |
by GrandFather (Saint) on Apr 08, 2009 at 03:28 UTC | |
by Marshall (Canon) on Apr 08, 2009 at 04:43 UTC |