I have several thousand text files in a directory i need to process.
Similarly named, but with some variation:
/home/dir/abc123.name.efg-joe_p000.20110124.csv
/home/dir/abc456.name.efg-jon_p000.20110124.csv
/home/dir/abc789.name.efg-bob_p000.20110124.csv
I have a perl script that can process one file at a time without a problem:
./script.pl /home/dir/abc123.name.efg-joe_p000.20110124.csv
What’s the best way to pass in and process many of these files, one a time? Am I looking at ARGV for this?
Should I list the files in a separate file and then use that as input?
If by “optimal” you mean “no code changes,” and you are, as your pathnames suggest, on a *NIX-like system, try this:
If
script.plcan handle multiple filename arguments, you might parallelize, say, 10 at a time: