
boobz
New User
Mar 27, 2008, 6:59 AM
Post #4 of 4
(1716 views)
|
|
[SOLVED] split file using ascii code 12
[In reply to]
|
Can't Post
|
|
For the records, here is the solution :
#!/usr/bin/perl # $count = 0; my $filename = 'input.txt'; open my $infh, '<', $filename or die("$!\n"); { local $/ = chr(12); while (my $block = <$infh>) { chomp; $count += 1; open my $outfh, '>', "slice$count.txt" or die "$!\n"; print $outfh $block; close $outfh; } }
|