in reply to Splitting a Blocked file in Round Robin into smaller files
EDIT: Just noticed other replies, looks this is NOT what he/she was after.use strict; use warnings; my @array = qw( 1nkndnfd 2nsnskdnsdn 3ddjsjd 4fksjsdj 5kdsjdskjdskj 1ksdjdjsk hg 2dsjskj 3djkdjsljs 4fdkkjdskjsk 5sadjjdjdodjs 6sadjjdjdodjs ); foreach (@array) { my ( $num, $data ) = /(\d)(.*)/; next if ( !length $num || !length $data || $num !~ /[1-5]/ ); open my $file, '+>>', "round_robin_$num" . ".txt"; print $file "$num - $data\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Splitting a Blocked file in Round Robin into smaller files
by tradersjoe0 (Novice) on Dec 14, 2015 at 16:25 UTC | |
by james28909 (Deacon) on Dec 14, 2015 at 16:27 UTC |