Re: Another Regex Question

2001-06-22 Thread M.W. Koskamp
- Original Message - From: Jack Lauman <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, June 21, 2001 11:48 PM Subject: Another Regex Question > I'm trying to create a CSV file from the text data below. Lines > containing High and Low Tide data have 9 fields, lines having >

Re: Another Regex Question

2001-06-22 Thread Jos Boumans
assuming i'm understanding correctly what you want, you might want to try this: use strict; use vars qw(@store); open I, "input.txt" or die "oops: $!\n"; while(){ my @foo = /(.+?)\s+(.+?)\s{2,}(.+?)(?:\s{2,}(.+))?$/; push @store, \@foo } @store will now hold all matches on your input file, whi

Re: Another Regex Question

2001-06-21 Thread Ken
One thing to do would be to test for Tide in the line(Assuming all tide data ends with the word "Tide") right away...then do special stuff for each case in an if: if( /Tide$/ ) # If last word in line is Tide { } else # Must be lunar { } And just a note, if you're just going to put the date a