in reply to Re^2: Analyzing Files Within a Directory
in thread Analyzing Files Within a Directory
For the second part, "parse out the results by field, e.g., the batch ID/job ID.". That sounds like you need some sort of regex to do file name matching? You might want to consider File::Find::Rule. In some more complicated scenarios, this can make the program logic easier to understand and implement. My requirements are usually straight-forward enough that I don't need it, but you should at least be aware of this option.
Update: A few more comments:
Will File::Find make it easier to find each with also specifying each individual file's batch ID/job ID numbers? File::Find solves the problem of writing the code of recursively descending through the the directory structure. This is well tested code that works. You can then focus on the job of deciding what to do with each file. In O/S file system lingo, a directory is actually just another type of a "file". The -f test will tell you whether a name is a simple plain file or not as opposed to a directory, or some kind of link. Not that the "directories of '.' and '..'" will occur, but are normally skipped.
Also note that huck made some good suggestions, although I am not sure if your level of experience allows you to completely understand his code. There are some "above beginner" aspects to it. Nothing derogatory is intended.
I suggest you start with my code as a prototype and see how you get on with that. By all means ask if you have questions.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Analyzing Files Within a Directory
by afoken (Chancellor) on Mar 21, 2017 at 05:08 UTC | |
by afoken (Chancellor) on Mar 24, 2017 at 07:28 UTC |