Hi All,
Following is the sample file
and following is the op desired
that is the last entry of each unique first field is required.
My solution is as follows
However the original file has around a million entries and around a 100,000 uniques first fields, so this soln.... (6 Replies)
Hi
I need some help with XML file parsing. I have an XML file with the below tag,
I need a script to identify the value of srvcName which is this case is "AAA srvc name". I need to put contents of this value which is AAA srvc and name into different variables using an array and then reformat it... (6 Replies)
Well I have read several threads on the subject ... but being a newbie like me makes it hard to understand ...
What I need is the following:
Input data:
------- snip ---------
<FavouriteLocations> <FavouriteLocations class="FavouriteList"><Item... (6 Replies)
hi guys, great help to the original question, can i expand please?
i have large files filled with blocks like this
<Placemark>
network type: hot
line1
line2
line3
<styleUrl>red.png</styleUrl>
</Placemark>
<Placemark>
network type: cold
line1
line2
line3... (3 Replies)
Hello!
We need to parse weblogic config.xml file and display rows in format:
machine:listen-port:name:application_name
In our enviroment the output should be (one line for every instance):
Crm-Test-Web:8001:PIA:peoplesoft
Crm-Test-Web:8011:PIA:peoplesoft... (9 Replies)
Hello,
I have the following xml file as an input.
<?xml version="1.0" encoding="UTF-8"?>
<RECORDS PS3_VERSION="1104_01"><RECORD>
<POI_ID>931</POI_ID>
<SUPPLIER_ID>2</SUPPLIER_ID>
<POI_PVID>997920846</POI_PVID>
<DB_ID>1366650925</DB_ID>
<REGION>H1</REGION>
<POI_NAME NAME_TYPE="Official"... (4 Replies)
I am trying to parse the XML Google contact file using tools like xmllint and I even dived into the XSL Style Sheets using xsltproc but I get nowhere.
I can not supply any sample file as it contains private data but you can download your own contacts using this script:
#!/bin/sh
# imports... (9 Replies)
Hi,
Need help with parsing xml data in unix and place it in a csv file. My xml file looks like this:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<iwgroups>
<nextid value="128">
</nextid>
<iwgroup name="RXapproval" id="124" display-name="RXapproval"... (11 Replies)
Discussion started by: ajayakunuri
11 Replies
LEARN ABOUT DEBIAN
xml::parser::lite::tree
XML::Parser::Lite::Tree(3pm) User Contributed Perl Documentation XML::Parser::Lite::Tree(3pm)NAME
XML::Parser::Lite::Tree - Lightweight XML tree builder
SYNOPSIS
use XML::Parser::Lite::Tree;
my $tree_parser = XML::Parser::Lite::Tree::instance();
my $tree = $tree_parser->parse($xml_data);
OR
my $tree = XML::Parser::Lite::Tree::instance()->parse($xml_data);
DESCRIPTION
This is a singleton class for parsing XML into a tree structure. How does this differ from other XML tree generators? By using
XML::Parser::Lite, which is a pure perl XML parser. Using this module you can tree-ify simple XML without having to compile any C.
For example, the following XML:
<foo woo="yay"><bar a="b" c="d" />hoopla</foo>
Parses into the following tree:
'children' => [
{
'children' => [
{
'children' => [],
'attributes' => {
'a' => 'b',
'c' => 'd'
},
'type' => 'element',
'name' => 'bar'
},
{
'content' => 'hoopla',
'type' => 'text'
}
],
'attributes' => {
'woo' => 'yay'
},
'type' => 'element',
'name' => 'foo'
}
],
'type' => 'root'
};
Each node contains a "type" key, one of "root", "element" and "text". "root" is the document root, and only contains an array ref
"children". "element" represents a normal tag, and contains an array ref "children", a hash ref "attributes" and a string "name". "text"
nodes contain only a "content" string.
METHODS
"instance()"
Returns an instance of the tree parser.
"new( options... )"
Creates a new parser. Valid options include "process_ns" to process namespaces.
"parse($xml)"
Parses the xml in $xml and returns the tree as a hash ref.
AUTHOR
Copyright (C) 2004-2008, Cal Henderson, <cal@iamcal.com>
SEE ALSO
XML::Parser::Lite.
perl v5.12.3 2011-06-04 XML::Parser::Lite::Tree(3pm)