Hello everyone, I have a large text file which I want to break up
and insert each chapter in an individual array. How can I do that...
this is what I have so far:
#__________________________________________________________
open(FILE1, "c:\perl\stories.txt") or die "Can't open stories.txt:
$!n";
while( <FILE1> ) {
s/S*$//;
s/s*//;
s/^s*//;
chomp;
push myarray, $_ ;
}
close FILE1;
#__________________________________________________________
This algorithm allows me to add each line of the text file into the
Array 'myarray'
My file has 7 chapters and would like to assign each chapter into
one of seven arrays...meaning chapter 1 goes to mychapter1, chapter
2 goes to mychapter2...and so on....
Each chapter has the string 'CHAPTER' at the begining of a chapter.
Any help will be appreciated....thanks in advanced.
>>>>> "paotrader" == paotrader < paolo%40snet.net">paolosnet.net> writes:
paotrader> My file has 7 chapters and would like to assign each chapter into
paotrader> one of seven arrays...meaning chapter 1 goes to mychapter1, chapter
paotrader> 2 goes to mychapter2...and so on....
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
< merlyn%40stonehenge.com">merlynstonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!