
BillKSmith
Veteran
Dec 4, 2011, 6:15 AM
Post #2 of 3
(1369 views)
|
|
Re: [cycleops] calendar records
[In reply to]
|
Can't Post
|
|
This should get you started.
use strict; use warnings; my @entry; my $new_day; while (my $line = <DATA>) { if ( $line =~ /^([1-9]|[12]\d|3[01])\s*$/ ) { $new_day = $1; next; } die 'internal error' if !$new_day; $entry[$new_day] .= $line; } for my $day (1..4) { print $day, "\n", $entry[$day], "\n"; } __DATA__ 1 blah, blah, blah over 2 lines 2 3 2nd something or other starting at 8 p.m. sometimes more than one line for the entry 4 Good Luck, Bill
|