A
Anton van der Steen
Hey fellow Perl addicts,
Since long I struggled with the problem to pump large files of many many
Gigs to a different place on a server or netwerk.
Well it took some research, but here is the solution:
1.use perl
2. rename the extension of the file to something exoctic like sex. This is
by far out an unkowm extension not used by Mikrosoft.
3. Use script see below and look at the packages of perl that have to be
installed, it is only one namely File::Find:
#!perl/bin/perl
use File::Find;
my @files = find(\&cleanup, "e:\\");
sub cleanup {
if ((/\.sex$/) ) #|| (/\.fun$/)
{
my $doc_1 = substr($File::Find::name, 0, 2 );
my $doc_2 = substr($File::Find::name, 4 );
my $doc_3 = join "",$doc_1,"/",$doc_2;
open FILE ,"<$doc_3" or die $!;
my $file_out = "e:/dump7/resultaat.txt";
open(OUT,">>$file_out");
while (<FILE>)
{
print OUT ;
}
close FILE;
}
}
4. Eureka !!! a file has born on the other side off the wall.
Otherwise you have to buy expensive tools which can do this,
but no Perl comes to the rescue.
5. Have fun.
Anton Vandersteen
Eindhoven/The Netherlands
Since long I struggled with the problem to pump large files of many many
Gigs to a different place on a server or netwerk.
Well it took some research, but here is the solution:
1.use perl
2. rename the extension of the file to something exoctic like sex. This is
by far out an unkowm extension not used by Mikrosoft.
3. Use script see below and look at the packages of perl that have to be
installed, it is only one namely File::Find:
#!perl/bin/perl
use File::Find;
my @files = find(\&cleanup, "e:\\");
sub cleanup {
if ((/\.sex$/) ) #|| (/\.fun$/)
{
my $doc_1 = substr($File::Find::name, 0, 2 );
my $doc_2 = substr($File::Find::name, 4 );
my $doc_3 = join "",$doc_1,"/",$doc_2;
open FILE ,"<$doc_3" or die $!;
my $file_out = "e:/dump7/resultaat.txt";
open(OUT,">>$file_out");
while (<FILE>)
{
print OUT ;
}
close FILE;
}
}
4. Eureka !!! a file has born on the other side off the wall.
Otherwise you have to buy expensive tools which can do this,
but no Perl comes to the rescue.
5. Have fun.
Anton Vandersteen
Eindhoven/The Netherlands