advanced code snippet search
counter202 on 01/25/09
file duplicates lines
01/25/09 11:42am
URL: http://www.daniweb.com/code/snippet631.html
#!/usr/bin/perl use strict;use warnings; my $file = '/path/to/file.txt';my %seen = ();{ local @ARGV = ($file); local $^I = '.bac'; while(<>){ $seen{$_}++; next if $seen{$_} > 1; print; }}print "finished processing file.";
Report this snippet Tweet
Comment:
You need to login to post a comment.