これはタスクの一部です (Perl で)。中間部分を共有するファイルのグループを見つける:
use strict;
use warnings;
my @files = qw/
example_12345_8943759847.csv
example_23456_9859877.csv
example_34567_92837458738.csv
example_12345_1165253.csv
example_23456_9983632652.csv
example_23456_2345.csv
/;
my %middles;
#This creates a hash. The keys are the middle number;
#the values are arrays of filenames that share that middle number.
foreach (@files)
{
push @{$middles{$1}},$_ if (/[a-z]+_(\d+)_\d+\.csv/);
}
#Now process the results
foreach my $middle (keys %middles)
{
#Get a group of filenames sharing the same middle part.
my @files_to_join = @{$middles{$middle}};
#Join them here...
}
残りは、「参加」の意味によって異なります。このText::CSV
モジュールは、 CSV ファイルの処理に役立つ場合があります。