Re: parsing a line



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@xxxxxxxxx>
To: alok nath <aloknathlight@xxxxxxxxx>
Cc: beginners@xxxxxxxx
Sent: Thursday, June 28, 2007 6:38:09 PM
Subject: Re: parsing a line


On 6/28/07, alok nath <aloknathlight@xxxxxxxxx> 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/

Relevant Pages

  • Regex to extract numbers between "[ ]"
    ... I'm parsing a log file that contains numbers ... I need to extract them so that I can convert them to ... Meet the all-new My Yahoo! ...
    (perl.beginners)
  • Re: Extract attribute from huge xml file
    ... I have a huge XML file, 1.7GB, 53080215 lines. ... I would like to extract a few hundred records so I can experiment. ... The file sits on a *nix system but I was going to do the parsing to on a Win32 workstation rather than steal all the memory on a server. ...
    (perl.beginners)
  • regular expressions -- how to ignore whitespace
    ... I need to extract some data from a web page that I'm parsing, ... This pattern works for most of the page I'm parsing, ... there's extra spaces in the tag, for instance: if the html starts like: ...
    (comp.lang.java.programmer)
  • Re: Parse Word/HTML Docs for database inserts
    ... I'm not able to help with the parsing, but if you want to check all ... What I need to do is also extract the mimetype, ... Can I do this with Ruby? ... Never have written Ruby code ...
    (comp.lang.ruby)
  • Extract attribute from huge xml file
    ... I have a huge XML file, 1.7GB, 53080215 lines. ... and methods for parsing. ... I would like to extract a few hundred records so I can ...
    (perl.beginners)