np.. I forgot to CC the list those past few times.

> -----Original Message-----
> From: Nazary, David [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 23, 2002 1:34 PM
> To: 'Nikola Janceski'
> Subject: RE: unexpected results with grep 
> 
> 
> It worked just fine. Thanks very much for you help Nikola.
> 
> Regards
> David 
> 
> -----Original Message-----
> From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, April 23, 2002 10:22 AM
> To: 'Nazary, David'
> Subject: RE: unexpected results with grep 
> 
> 
> well.. that means $names (actually the value of $names) is 
> not found in
> @labels anywhere.
> perhaps you should chomp(@names = <NAMES>); so you don't try 
> matching for \n
> in the /$names/
> 
> 
> 
> > -----Original Message-----
> > From: Nazary, David [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, April 23, 2002 1:18 PM
> > To: 'Nikola Janceski'
> > Subject: RE: unexpected results with grep 
> > 
> > 
> > That is exactly what I did. See below:
> > 
> > @labeled_names = grep (/$names/, @labels);
> > 
> > and grep finds nothing. I wonder if I have to escape the $ in 
> > /$names/. 
> > 
> > 
> > -----Original Message-----
> > From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, April 23, 2002 10:15 AM
> > To: 'Nazary, David'
> > Subject: RE: unexpected results with grep 
> > 
> > 
> > @labeled_names = grep (//, @labels);
> >                             ^
> >                     What goes in here:
> >     Is what you want to match for in @labels and put in 
> > @labeled_names;
> > 
> > > -----Original Message-----
> > > From: Nazary, David [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, April 23, 2002 1:12 PM
> > > To: 'Nikola Janceski'; '[EMAIL PROTECTED]'
> > > Subject: RE: unexpected results with grep 
> > > 
> > > 
> > > instead of $_ I used $name but nothing was found by grep. 
> > > What do you mean
> > > by another variable?
> > > 
> > > 
> > > -----Original Message-----
> > > From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
> > > Sent: Tuesday, April 23, 2002 9:40 AM
> > > To: 'Nazary, David'; '[EMAIL PROTECTED]'
> > > Subject: RE: unexpected results with grep 
> > > 
> > > 
> > > inside grep $_ is a special var assigned to each value of 
> the array.
> > > use another var for the //;
> > > 
> > > 
> > > > -----Original Message-----
> > > > From: Nazary, David [mailto:[EMAIL PROTECTED]]
> > > > Sent: Tuesday, April 23, 2002 12:29 PM
> > > > To: '[EMAIL PROTECTED]'
> > > > Subject: unexpected results with grep 
> > > > 
> > > > 
> > > > Hi,
> > > > 
> > > > I am trying to use grep in a simple perl script to find all 
> > > > the lines in a
> > > > list (@labels) that contain certain names in a list (@names). 
> > > > The problem is
> > > > that grep finds all the lines in @labels  for every name in 
> > > > the @names. here
> > > > is the script:
> > > > 
> > > > >>>>>>>>>>>>
> > > > 
> > > > open(NAMES, "names");
> > > > open(LABELS, "labels");
> > > > @labels = <LABELS>;
> > > > @names = <NAMES>;
> > > > 
> > > > foreach $name (@names){
> > > >         open(NEW, ">$name");    #create a file with the name 
> > > > from  @names
> > > >         @labeled_names = grep (/$_/, @labels);
> > > >         print NEW @labeled_names;
> > > >         @labeled_names = "";            #clear the list for the 
> > > > next name
> > > >         close NEW;
> > > > }
> > > > close NAEMS;
> > > > close LABELS;
> > > > 
> > > > >>>>>>>>>>>>>
> > > > 
> > > > any idea what is not write here?
> > > > 
> > > > Thanks in advance
> > > > David
> > > >  
> > > > 
> > > > 
> > > > -- 
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > 
> > > 
> > > --------------------------------------------------------------
> > > --------------
> > > --------------------
> > > The views and opinions expressed in this email message are 
> > > the sender's
> > > own, and do not necessarily represent the views and 
> > opinions of Summit
> > > Systems Inc.
> > > 
> > > 
> > > -- 
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > 
> > > -- 
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > 
> > 
> > --------------------------------------------------------------
> > --------------
> > --------------------
> > The views and opinions expressed in this email message are 
> > the sender's
> > own, and do not necessarily represent the views and 
> opinions of Summit
> > Systems Inc.
> > 
> 
> --------------------------------------------------------------
> --------------
> --------------------
> The views and opinions expressed in this email message are 
> the sender's
> own, and do not necessarily represent the views and opinions of Summit
> Systems Inc.
> 

----------------------------------------------------------------------------
--------------------
The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to