<br>Hi everyone,<br>Need your help once again<br><br>I have a a kml file for parsing (please find the attachment below) I have used XML::Simple for parsing &amp; for storing the value by hash array(key, value).<br><br>Below is the code::<br>
******************************************************************************************<br>
#!/usr/bin/perl<br>use XML::Simple;<br>use Data::Dumper; <br><br>my $file = &#39;Al waab B villa.kml&#39;;<br><br>#create a object<br>my $xm1 = XML::Simple-&gt;new();<br><br>#read XML file<br>my $data = $xm1-&gt;XMLin(&quot;Al waab B villa.kml&quot;);<br>

<br>print Dumper($data);<br><br>my $tags = $data-&gt;{Document}-&gt;{Placemark}-&gt;{LookAt};<br>my %hash;<br>my $val;<br><br>foreach $val (keys %$hello) {<br>push @{$hash{$tags}}, $val;<br>    }<br>print Dumper \%hash;<br>

<br>******************************************************************************************<br><br>I get output as:<br><br><br>$VAR1 = {<br>          &#39;HASH(0x1ad903c)&#39; =&gt; [<br>                                 &#39;longitude&#39;,<br>

                                 &#39;latitude&#39;,<br>                                 &#39;heading&#39;,<br>                                 &#39;tilt&#39;,<br>                                 &#39;range&#39;,<br>                                 &#39;altitudeMode&#39;,<br>

                                 &#39;altitude&#39;<br>                               ]<br>        };<br><br><br>For a single key I want tag values between them not the name.<br><br>And I want output as::(with a pipe operator between each value)<br>

<br>LookAt =&gt; 51.47891287538003|25.26764114641654|0|3709.372423858944|0-0.002617566196780602|relativeToGround<br><br>        wating for your replies.<br>Thanks in advance.    <br><div class="gmail_quote">On Sun, Jun 14, 2009 at 10:57 PM, sairam pareek <span dir="ltr">&lt;<a href="mailto:mariassai@gmail.com" target="_blank">mariassai@gmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Thanks for your replies,<br>

<br>

I m happy to be in this group, I tried the given solutions, they are working fine.<br>
<br>

If I have some problem further Ill let you know.<br><br>Thanks once again.<div><div></div><div><br><br><div class="gmail_quote">On Sun, Jun 14, 2009 at 10:02 PM, simran <span dir="ltr">&lt;simran@tlims.cc&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
probably best to use the XML::Simple module... <br><div><br><a href="http://search.cpan.org/%7Egrantm/XML-Simple-2.18/lib/XML/Simple.pm" target="_blank">http://search.cpan.org/~grantm/XML-Simple-2.18/lib/XML/Simple.pm</a><br>


<br></div><div class="gmail_quote">
2009/6/15 wolf <span dir="ltr">&lt;<a href="mailto:superpulse.x@gmail.com" target="_blank">superpulse.x@gmail.com</a>&gt;</span><div><div></div><div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">



Hey,<br><br>I used your KML file ( renamed it of course ):<br>                 <br>cat test.kml | perl -ne &#39; print &quot;$1: $2\n &quot; if m!&lt;(longitude|latitude)\s*?&gt;\s*?([0-9\.]+)\s*?!&#39;<br><br>Hope this helps,<br>




<br>Cheers,<br>V<br><br><br><div class="gmail_quote">2009/6/14 sairam pareek <span dir="ltr">&lt;<a href="mailto:mariassai@gmail.com" target="_blank">mariassai@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">



<div><div></div><div>
Hello everyone.<br><br>I have a kml file, and struggling to write a perl script to parse its value between tags, this is my first task.<br>and the second is to update the value between the tag in the postgresql database table. I m attaching the KML file, Please find the attachment. (I want to parse the longitude, latitude vlaues in these) <br>





                                               <br>                                                                Please help me, its urgent. Waiting for your replies. Hoping for great help from you guys. I wanted to use regular expression for this. I found this group on orkut.<br>





                                      Thanks in advance.<br><br>Regards, <br>Sairam <br><font color="#888888"><br>-- <br>&quot;It is not how much you do, but how much love you put in the doing.&quot;<br>
</font><br></div></div>_______________________________________________<br>
Bangalore-pm mailing list<br>
<a href="mailto:Bangalore-pm@pm.org" target="_blank">Bangalore-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/bangalore-pm" target="_blank">http://mail.pm.org/mailman/listinfo/bangalore-pm</a><br></blockquote></div><br>
<br>_______________________________________________<br>
Bangalore-pm mailing list<br>
<a href="mailto:Bangalore-pm@pm.org" target="_blank">Bangalore-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/bangalore-pm" target="_blank">http://mail.pm.org/mailman/listinfo/bangalore-pm</a><br></blockquote></div></div></div><br>
</blockquote></div><br><br clear="all"><br>-- <br>&quot;It is not how much you do, but how much love you put in the doing.&quot;<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>&quot;It is not how much you do, but how much love you put in the doing.&quot;<br>