This is not turn key code, but hopefully it will provide some guidance.
Some problems:
I don't understand your pattern, it doesn't look perlish.
Certainly comment out test data generation.
There will be problems if input files have different sizes.
This uses my current favorite Path::Tiny but could be adopted to others.
#!/usr/bin/perl # http://perlmonks.org/?node_id=1198355 use strict; use warnings; use Path::Tiny; use Storable qw(nstore retrieve); my $column = 1; # these could be passed i +n... my $filepattern = qr/(thing.*).foo__bar_ar/; my $projectdirectory = './some'; # make test data path("$projectdirectory/$_")->mkpath for qw( one two/three ); nstore [[1.34, 2.53], [3.26, 4.001]], "$projectdirectory/one/thing1.fo +o__bar_ar"; nstore [[5.55, 6.911], [7.373, 8.808]], "$projectdirectory/two/three/thing3.foo__bar_ar"; # end make test data my @answer; my $header = 'Number'; path($projectdirectory)->visit( sub { my ($path) = @_; /$filepattern/ or return; $header .= ", $1"; my $arrayref = retrieve($path); my $number = 0; $answer[$number++] .= ", " . $_->[$column] for @$arrayref; }, { recurse => 1 } ); my $number = 1; $_ = $number++ . "$_\n" for @answer; print "$header\n", @answer;
In reply to Re: Consolidating nstore arrays
by tybalt89
in thread Consolidating nstore arrays
by Speed_Freak
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |