Thread ab Zeile 32008 alles in eine neue Datei schreiben (8 answers)
Opened by Relais at 2013-11-16 12:13

Gast wer
 2013-11-16 14:08
#172116 #172116
Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/perl
use strict;
use warnings;

die "USAGE:\n$0 <line> <filein> <fileout>\n" if @ARGV<3;
my ($cnt,$fin,$fout)=@ARGV;
open(my $ifh, '<:raw',$fin) or die "Error open $fin : $!\n";
<$ifh> while $cnt-- > 0;
$/=undef;
open(my $ofh, '>:raw',$fout) or die "Error open $fout : $!\n";
my $buff='';
print $fho $buff while(read $fh,$buff,4096);
close $fho;
close $ifh;

Last edited: 2013-11-16 14:22:37 +0100 (CET)

View full thread ab Zeile 32008 alles in eine neue Datei schreiben