Re: Assign regex match to variable in while loop

2008-09-23 Thread Clemens Bieg
Thanks. Both solutions work. On Tue, Sep 23, 2008 at 9:19 PM, Clemens Bieg <[EMAIL PROTECTED]> wrote: > Thanks. > > On Tue, Sep 23, 2008 at 8:25 PM, John W. Krahn <[EMAIL PROTECTED]> wrote: > >> Clemens Bieg wrote: >> >>> Hello, >>> >>> I am trying to iterate over all the lines of a file, each o

Re: Assign regex match to variable in while loop

2008-09-23 Thread Clemens Bieg
Thanks. On Tue, Sep 23, 2008 at 8:25 PM, John W. Krahn <[EMAIL PROTECTED]> wrote: > Clemens Bieg wrote: > >> Hello, >> >> I am trying to iterate over all the lines of a file, each of which starts >> with a line number, and isolate the line number and the corresponding >> string >> into one varia

Re: Assign regex match to variable in while loop

2008-09-23 Thread John W. Krahn
Clemens Bieg wrote: Hello, I am trying to iterate over all the lines of a file, each of which starts with a line number, and isolate the line number and the corresponding string into one variable each, then have them printed into a separate file. Could someone give me a clue on how to assign the

Re: Assign regex match to variable in while loop

2008-09-23 Thread Mr. Shawn H. Corey
On Tue, 2008-09-23 at 20:05 +0200, Clemens Bieg wrote: > while (<$fh_in_extract>) { > >if ($id = m/^\d+/) { if( ( $id ) = m/^(\d+)/ ){ >print $fh_out_final $id; >} > } -- Just my 0.0002 million dollars worth, Shawn Linux is obsolete. -- Andrew Tanenbaum -- To unsubscribe,

Assign regex match to variable in while loop

2008-09-23 Thread Clemens Bieg
Hello, I am trying to iterate over all the lines of a file, each of which starts with a line number, and isolate the line number and the corresponding string into one variable each, then have them printed into a separate file. Could someone give me a clue on how to assign the line number match to