Algo como esse perl deve funcionar. Substitua nomes de arquivos quando apropriado.
#!/usr/bin/env perl
use strict;
use warnings;
use IO::Handle;
open(my $list_fh, '<', 'somefile') or die "Failed to open list file: $!";
open(my $out_fh, '>', 'outfile') or die "Failed to open out file: $!";
my $merge_fh = IO::Handle->new();
my $cur_fname = q{};
my $buff;
while ( my $line = <$list_fh> ) {
next if $line =~ /^\s?#/;
chomp($line);
my ($fname, $begin, $end) = split(/\s+/, $line);
if ( $cur_fname ne $fname ) {
$merge_fh->close() if $merge_fh->opened();
open($merge_fh, '<', $fname) or die "Failed to open file: $!";
$cur_fname = $fname;
}
seek($merge_fh, $begin, 0);
read($merge_fh, $buff, $end - $begin);
print {$out_fh} $buff or die "Failed to write to $cur_fname: $!";
}
$merge_fh->close();
$out_fh->close();
$list_fh->close();