$ cat part.001 part.002 part.003 > completefile
#!/usr/bin/perl
use FileHandle;
use DirHandle;
my $arg = $ARGV[0] || die "Need an argument!\n";
if( $arg =~ m/(.*)\.\d{2,3}$/ ) { $arg = $1; }
my $dir = DirHandle->new(".");
my $fn, @files;
while( defined( $_ = $dir->read() ) ) {
next if -d $_;
next unless m/\Q$arg\E\.\d{2,3}$/;
push( @files, $_ );
}
if( $#files == 0 ) {
print "Didn't find any parts\n";
exit(0);
}
my $of = FileHandle->new("$arg","w");
foreach $fn (sort @files) {
print "$fn:";
if( $fn =~ m/.*\.000$/ ) {
print "Skipping\n";
next;
}
my $if = FileHandle->new("$fn","r");
while( ! $if->eof() ) {
my $temp = $if->getline();
print $of $temp;
}
print "Added\n";
}
$of->close();
$ mpjoin.pl somefile
and it will join somefile.001, somefile.002 etc. and save it as somefile.SirDice said:This will do it:
$ cat part.001 part.002 part.003 > completefile
But this will get somewhat annoying if you have 30-40 parts.
$ cat part.* > completefile
vermaden said:What about that?
$ cat part.* > completefile
SirDice said:You can't be sure of the order
% :> part.005
% :> part.002
% :> part.004
% :> part.003
% :> part.001
% echo part.*
part.001 part.002 part.003 part.004 part.005
%
echo part.*
part.0 part.1 part.10 part.11 part.12 part.13 part.14 part.15 part.16 part.17 part.18 part.19 part.2 part.20 part.21 part.3 part.4 part.5 part.6 part.7 part.8 part.9
mfaridi said:if these file is AVI , dose this method work ?
$ mencoder -forceidx -ovc copy -oac copy -o mymovie.avi mymovie-cd1.avi mymovie-cd2.avi
mfaridi said:all of these file is movie , this movie splite part.001 and part.002 and ...
in windows we can use program to join them