use strict;

open F, "sourcefile.txt";
local $/ = "\n\n";
my @sections = <F>;
close F;

print "Section $_ :\n $sections[$_]\n\n" for @sections;

HTH,
Bee


----- Original Message ----- 
From: "Kevin Old" [EMAIL PROTECTED]
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 21, 2004 10:27 AM
Subject: Parsing multiline data


Hello everyone,

I have several "sections" of data that look like this:

Title: DESIGN JOURNAL (COVER)
Purpose: Product Spotlight
Penetration: National
Role: Media Relations, Content Support
Results: Elevated Publicity and Brand Awareness
Credits: Evolutif Senior Management Team
Award: 2001 Award for Design Excellence â Max V Armchair

Each "section" is separated by an empty line.  I'd like to capture one
"section" at a time, and then when each section has been captured, I'd
like to write it to a database.  I just can't figure out how to
identify the end of the section.

Any ideas how I'd do this?

Thanks,
Kevin
-- 
Kevin Old
[EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to