Use the split command.

open(INFILE,"hobbitbooks.txt");
while(INFILE){
        @results = split /\"/,$_;
        print $results[1];
}

-----Original Message-----
From: Booher Timothy B 1stLt AFRL/MNAC
[mailto:[EMAIL PROTECTED]]
Sent: Friday, February 01, 2002 3:28 PM
To: [EMAIL PROTECTED]
Subject: one question to end the day on . . .


Hello out there - I have learned a lot of Perl today, but I am still trying
to figure one more thing out.
 
How can I go through a file and extract all the text between certain
delimiters - for example I have:
 
Bilbo, "Why I like rings" Freemont Press, 1998.
Frodo, "Why I don't" Bridgedale Freemans, 1832
Etc
 
I want to get:
 
Why I like rings
Why I don't
 
It seems like there should be a real quick way to do this. . . thoughts?
 
tim


--------------------------------------------------------------------------------
This email may contain confidential and privileged 
material for the sole use of the intended recipient. 
If you are not the intended recipient, please contact 
the sender and delete all copies.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to