in reply to Counting iterations of 1 and 0
Untested, but worth a try nonetheless ??use warnings; use strict; use autodie; open IN, "<file.txt"; binmode IN; my @content = <IN>; close IN; foreach my $num (keys %rec) { my @count = ("@content" =~ /$num+/sg); open my $fh, ">iterations$num.txt"; print "$_\n" for @count; close $fh; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Counting iterations of 1 and 0
by AwsedreswA (Initiate) on Feb 01, 2014 at 06:11 UTC | |
by Bloodnok (Vicar) on Feb 03, 2014 at 13:52 UTC | |
by AwsedreswA (Initiate) on Feb 04, 2014 at 08:19 UTC | |
by Bloodnok (Vicar) on Feb 04, 2014 at 17:52 UTC | |
by AwsedreswA (Initiate) on Feb 05, 2014 at 01:22 UTC |