Re: multiline matching

2004-01-16 Thread James Edward Gray II
On Jan 15, 2004, at 8:30 PM, Kenton Brede wrote: Thanks for the great explanation. I've been working with the code above since I need more hash practice, trying to keep on track with the original poster's question. The code below works fine except I can't figure out how to put one "\n" between

Re: multiline matching

2004-01-15 Thread Kenton Brede
On Thu, Jan 15, 2004 at 08:38:11AM -0600, James Edward Gray II ([EMAIL PROTECTED]) wrote: > On Jan 14, 2004, at 10:28 PM, Kenton Brede wrote: > > >On Wed, Jan 14, 2004 at 09:57:51PM -0600, James Edward Gray II > >([EMAIL PROTECTED]) wrote: > >>On Jan 14, 2004, at 7:22 PM, Jose Malacara wrote: >

Re: multiline matching

2004-01-15 Thread James Edward Gray II
On Jan 14, 2004, at 10:28 PM, Kenton Brede wrote: On Wed, Jan 14, 2004 at 09:57:51PM -0600, James Edward Gray II ([EMAIL PROTECTED]) wrote: On Jan 14, 2004, at 7:22 PM, Jose Malacara wrote: Since you've already been shown the super easy way, I'll dare to be a little different: #!/usr/bin/perl

Re: multiline matching

2004-01-15 Thread drowl
> On Wed, Jan 14, 2004 at 06:22:58PM -0700, Jose Malacara wrote: >> Can someone explain to me how to do multiline matching? I am trying to >> extract three consecutive lines from a datafile containing multiple >> records like this: >> Hi All well i was reading through and i have a similar proble

RE: multiline matching

2004-01-14 Thread Tim Johnson
Just for the sake of showing another solution (even though I'm not doing any multi-line matching), how about: ## use strict; use warnings; open(INFILE,"myfile.txt") || die "Couldn't open myfile.txt for writing!\n"; while(){ my %person; $person{name} = $_; $p

Re: multiline matching

2004-01-14 Thread Kenton Brede
On Wed, Jan 14, 2004 at 09:57:51PM -0600, James Edward Gray II ([EMAIL PROTECTED]) wrote: > On Jan 14, 2004, at 7:22 PM, Jose Malacara wrote: > Since you've already been shown the super easy way, I'll dare to be a > little different: > > #!/usr/bin/perl > > use strict; > use warnings; > > $

Re: multiline matching

2004-01-14 Thread James Edward Gray II
On Jan 14, 2004, at 7:22 PM, Jose Malacara wrote: Can someone explain to me how to do multiline matching? I am trying to extract three consecutive lines from a datafile containing multiple records like this: Name: Bob City: Austin State: Texas Address: 123 Whatever Age: 46 Name: Jose City: Denv

Re: multiline matching

2004-01-14 Thread Daniel Staal
--As off Wednesday, January 14, 2004 6:22 PM -0700, Jose Malacara is alleged to have said: Can someone explain to me how to do multiline matching? I am trying to extract three consecutive lines from a datafile containing multiple records like this: Name: Jose City: Denver State: Colorado Address:

Re: multiline matching

2004-01-14 Thread Jose Malacara
Thanks, Jeff. I read over the reference, but I guess I am missing the syntax as I cannot get it to work properly. Can you point me to any examples? I found this example, but am having trouble translating it to my while loop: perl -e '$_ = "{a\n{bb}\n{c\n\nc}\na\}"; m({.*})m; print $&' Thanks a

Re: multiline matching

2004-01-14 Thread Kenton Brede
On Wed, Jan 14, 2004 at 06:22:58PM -0700, Jose Malacara wrote: > Can someone explain to me how to do multiline matching? I am trying to extract three > consecutive lines from a datafile containing multiple records like this: > > Name: Bob > City: Austin > State: Texas > Address: 123 Whatever > Ag

Re: multiline matching

2004-01-14 Thread Jeff Westman
Jose Malacara <[EMAIL PROTECTED]> wrote: > Can someone explain to me how to do multiline matching? I am > trying to extract three consecutive lines from a datafile > containing multiple records like this: Check out perldoc perlre What you should do is look at the 'm' (multiple line) option

Re: multiline matching

2003-07-04 Thread Rob Dixon
Mark Sony wrote: > Hi all, > > I am writing a program which will print variety of matches > having > keywords like insert,delete etc from another file .For this I > wrote a couple of sub routines one of which returns an > array(having the comments removed ).Then I face the problem : > A part of tha