develooper Front page | perl.beginners | Postings from June 2007

Re: parsing a line

Thread Previous | Thread Next
From:
alok nath
Date:
June 28, 2007 06:48
Subject:
Re: parsing a line
Message ID:
952759.87377.qm@web53209.mail.re2.yahoo.com
Hi,
    So I tried something like this .It works !

if( $_ =~ m/ID\s=\s"(.*?)"\sDirAbsolute/){
    print " Test ID is $1 \n" ;
   }else{
    print " FAILED to locate Test ID \n" ;
   }

  May be its crude way.

Thanks
Alok.
----- Original Message ----
From: Chas Owens <chas.owens@gmail.com>
To: alok nath <aloknathlight@yahoo.com>
Cc: beginners@perl.org
Sent: Thursday, June 28, 2007 6:38:09 PM
Subject: Re: parsing a line


On 6/28/07, alok nath <aloknathlight@yahoo.com> wrote:
> Hi,
>  I am parsing a file which has lines like this.
>  <Test Description = "Test 1" ID = "ID A1" DirAbsolute = "C:/perl"/>
>  Got stuck up while trying to extract values of fields called
>  Description, ID ?

What have you tried?


       
____________________________________________________________________________________Ready for the edge of your seat? 
Check out tonight's top picks on Yahoo! TV. 
http://tv.yahoo.com/
Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About