09-11-2009
Trick is in using the right tool for the right job.
There are modules already available in CPAN for xml parsing and creating xml stuff. Try them instead!
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I need to know the way. I have got parsing down some nodes. But I was unable to get the child node perfectly. If you have code please send it. It will be very useful for me. (0 Replies)
Discussion started by: girigopal
0 Replies
2. Shell Programming and Scripting
Hi , I need an Awk script to parse my log file .
2008-04-26 10:00:13,391 INFO Logger - <?xml version="1.0" encoding="UTF-8" standalone="no"?><2dm
tmsg... (0 Replies)
Discussion started by: amit1_x
0 Replies
3. Shell Programming and Scripting
Hi,
I am new to awk/nawk, needs help.
I want to merge the rows having emplid attribute same into a single row in the following file. In actual this kind of file will have around 50k rows.
Here is my input file
id|emplid|firstname|dep|lastname
1|001234|test|1001|1
2|002345|test|1032|2... (7 Replies)
Discussion started by: kumar04
7 Replies
4. Shell Programming and Scripting
Hi ,
I have an xml format as shown below:
<Info>
<last name="sean" first name="john"/>
<period="5" time="11"/>
<test value="1",test2 value="2",test3 value="3",test4 value="5">
<old>
<value1>1</value1>
<value2>2</value2>
</old>
<new>
<value1>4</value1>
<value2>3</value2>
</new>... (1 Reply)
Discussion started by: natalie23
1 Replies
5. UNIX for Dummies Questions & Answers
Thanks in advance who can answer.
I have to make a small shell that after reading an XML file and extract the fields I create a text file with the same fields taken previously in tabular form.
I did this
parse.awk
----------------------
BEGIN {
FS=""
}
{
for(i=2; i<=NF; i+=2) {
... (1 Reply)
Discussion started by: mcarlo65
1 Replies
6. Shell Programming and Scripting
Hello,
Hope you are doing fine. I have a file in following format. I only want to process the data inside the section that comes after #DATE,CODE,VALUE
#ITEMS WITH CORRECTIONS
.......
#DATE,CODE,VALUE
2011-08-02, ID1, 0.30
2011-08-02, ID2, 0.40
2011-08-02, ID3, 0.50
......
Means... (3 Replies)
Discussion started by: srattani
3 Replies
7. Shell Programming and Scripting
Hello Guys,
Please help with AWK problem. I have XML file which contains a list of messages for subjects.
Example of the messages:
, message=, message=, message=, message=, message=, message=, message=, message=
I want to use AWK to parse these xml messages but I am... (7 Replies)
Discussion started by: James_Owen
7 Replies
8. Shell Programming and Scripting
My source file looks like this:
Cust-Number = "101"
Cust-Name="Joe"
Cust-Town="London"
Cust-hobby="tennis"
Cust-purchase="200"
Cust-Number = "102"
Cust-Name="Mary"
Cust-Town="Newyork"
Cust-hobby="reading"
Cust-purchase="125"
Now I want to parse this file (leaving out hobby) and... (10 Replies)
Discussion started by: Balav
10 Replies
9. UNIX for Beginners Questions & Answers
Hi,
I have a file where I need to change the date format on the nth field from DD-MM-YYYY to YYYY-MM-DD so I can accurately sort the record by dates
From regex - Use sed or awk to fix date format - Stack Overflow, I found an example using nawk.
Test run as below:
$: cat xyz.txt
A ... (2 Replies)
Discussion started by: newbie_01
2 Replies
LEARN ABOUT DEBIAN
www::opensearch::description
WWW::OpenSearch::Description(3pm) User Contributed Perl Documentation WWW::OpenSearch::Description(3pm)
NAME
WWW::OpenSearch::Description - Encapsulate an OpenSearch Description provided by an A9 OpenSearch compatible engine
SYNOPSIS
use WWW::OpenSearch;
my $url = "http://bulkfeeds.net/opensearch.xml";
my $engine = WWW::OpenSearch->new($url);
my $description = $engine->description;
my $format = $description->Format; # or $description->format
my $longname = $description->LongName; # or $description->longname
DESCRIPTION
WWW::OpenSearch::Description is a module designed to encapsulate an OpenSearch Description provided by an A9 OpenSearch compatible engine.
See http://opensearch.a9.com/spec/1.1/description/ for details.
CONSTRUCTOR
new( [ $xml ] )
Constructs a new instance of WWW::OpenSearch::Description. If scalar parameter $xml is provided, data will be automatically loaded from it
using load( $xml ).
METHODS
load( $xml )
Loads description data by parsing provided argument using XML::LibXML.
urls( )
Return all of the urls associated with this description in an array.
get_best_url( )
Attempts to retrieve the best URL associated with this description, based on the following content types (from most preferred to least
preferred):
o application/atom+xml
o application/rss+xml
o text/xml
get_url_by_type( $type )
Retrieves the first WWW::OpenSearch::URL associated with this description whose type is equal to $type.
ACCESSORS
version( )
ns( )
AdultContent( )
Attribution( )
Contact( )
Description( )
Developer( )
Format( )
InputEncoding( )
Image( )
Language( )
LongName( )
OutputEncoding( )
Query( )
SampleSearch( )
ShortName( )
SyndicationRight( )
Tags( )
Url( )
AUTHOR
o Tatsuhiko Miyagawa <miyagawa@bulknews.net>
o Brian Cassidy <bricas@cpan.org>
COPYRIGHT AND LICENSE
Copyright 2005-2010 by Tatsuhiko Miyagawa and Brian Cassidy
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.10.1 2010-05-25 WWW::OpenSearch::Description(3pm)