in reply to Re: Count similar characters in a row - only once
in thread Count similar characters in a row - only once
Hi Anonymous Monk, I have had quite a thought about it and I think the thing I would most likely do is to first reduce complexity by removing all duplicated lines with the same integer infront of them. Is this right. I tried running the script below and then ran the script above -jgg.pl. But the result are not good. Any ideas or suggestions how I could marry the two in a sensible fashion
my $file = 'my_data_file.txt'; my %seen = (); { local @ARGV = ($file); #local $^I = '2.txt'; while(<>){ $seen{$_}++; next if $seen{$_} > 1; print; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Count similar characters in a row - only once
by Anonymous Monk on Jun 28, 2011 at 14:06 UTC | |
by $new_guy (Acolyte) on Jun 29, 2011 at 10:47 UTC | |
by Anonymous Monk on Jun 29, 2011 at 13:11 UTC |