> My goal is to automate this so that after specifying a folder, Perl will
pull the specified lines from each of the 25 txt files in that folder and
write them to a single output file.
If you don't need file names etc, you can just expand your pointies to use
a glob
@output = <*.txt>
but that put it all in there, so:
print ("\nESTIMATION\n");
print @output[18,21..24,28..31,206..208];
print "\nPOPULATION\n";
print @output[220,223..226,229..233,424..426];
would need to be done in ... increments of 427 or whatever the total
lines/file is. That seem fraught w/ peril but you know your data best.
I'd never trust line #s to be accurate, nor would I believe in fixed
length data files, but only as I've been well burned by both assumptions.
YMMV
You can use command line globbing (if you've got it):
myapp /this/data/*.txt
and then each file is opened one after the other. perldoc -f eof will help
if want to handle them one after the other. Otherwise, opendir and readdir
are the route - perldoc -f readdir gives the better sample code.
a
-------------------
Andy Bach
Systems Mangler
Internet: andy_b...@wiwb.uscourts.gov
Voice: (608) 261-5738; Cell: (608) 658-1890
Entropy just ain't what it used to be
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs