Speed_Freak has asked for the wisdom of the Perl Monks concerning the following question:
This is going to be a terrible post, because I'm starting from scratch here... But I have a variable number of files housed in a scratch directory that has been created in whatever project directory I am working out of at the time. (the project directory will change, and so will the file count.) I need to target a specific set of arrays (some of the files were created from arrays) based on their name, and those arrays have been created using nstore.
So I need to search the project directory for the scratch folder, then find all of the files that match this pattern: "thing1_(ABC-def1g234567).foo__bar_ar"
Then I need to pull out the data from one column(lets say 5)for every row from each array and place them in a report.(there are 150k rows in each file.
the final report would be something like:
Number, thing1, thing2, thing3, thing4
1, 0.55, 0.345, 0.243, 0.567
2, 0.678, 0.3, 0.4563, 0.546
3, 0.3243, 0.533, 0.44, 0.7
the numbers in the first column would need to be populated, but would correspond to the row that the data was read from. (each file has the same format, but the number isn't stored in those arrays.)
#this isn't really code, just my thoughts #!/usr/bin/perl -w use strict; use FindBin; use Data::Dumper; use DBI; use Storable qw(nstore retrieve); #something that looks for the scratch directory in the current directo +ry #something that looks for any files matching the pattern thing1_(ABC-d +ef1g234567).foo__bar_ar #something that cycles through each file one at a time, pulling all of + the rows for [5] and pushing them in order into an excel file matchi +ng the report format
I'm not asking for turn key code, I'm just looking for some guidance towards the donkey before I start trying to stick a tail on it. Thanks in advance!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Consolidating nstore arrays
by 1nickt (Canon) on Aug 30, 2017 at 21:16 UTC | |
|
Re: Consolidating nstore arrays
by tybalt89 (Monsignor) on Aug 31, 2017 at 01:14 UTC | |
by Speed_Freak (Sexton) on Aug 31, 2017 at 19:50 UTC | |
by tybalt89 (Monsignor) on Aug 31, 2017 at 20:01 UTC | |
by Speed_Freak (Sexton) on Aug 31, 2017 at 20:29 UTC | |
by tybalt89 (Monsignor) on Aug 31, 2017 at 20:45 UTC | |
| |
|
Re: Consolidating nstore arrays
by thanos1983 (Parson) on Aug 30, 2017 at 23:36 UTC | |
|
Re: Consolidating nstore arrays
by Speed_Freak (Sexton) on Aug 31, 2017 at 16:39 UTC |