Sponsored Content
Top Forums Shell Programming and Scripting Help in parsing XML output file in perl. Post 302745879 by Yoda on Tuesday 18th of December 2012 09:28:58 AM
Old 12-18-2012
Try this:
Code:
awk -F= '/(accumId="269"|accumId="270")/ {
 unit=$4; gsub(/(\"|inclUnitsUsed)/,"",unit);
 used=$5; gsub(/(\"|shared)/,"",used);
 shrd=$6; gsub(/(\"|pooled)/,"",shrd);
 printf "%s %s %s\n", unit, used, shrd;
 } ' xmlfile

This User Gave Thanks to Yoda For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

HTTP Query Request & Parsing returned XML output

I have a PERL script from which I need to make a HTTP request to Web Servlet (Essentially a URL with variables and values like &Variable1=AAAAAA&Variable2=BBBBBBBBB&Variable3=CCCCCCC). The Web servlet returns an XML result which needs to be parsed for the contents of the result within the program.... (15 Replies)
Discussion started by: jerardfjay
15 Replies

2. UNIX for Advanced & Expert Users

xml parsing error in perl

******************PERL VERSION************************ This is perl, v5.8.1 built for i386-linux-thread-multi ERROR!!!!---Undefined subroutine &main::start called at /usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/XML/Parser/Expat.pm line 469. *********************PERL... (1 Reply)
Discussion started by: bishweshwar
1 Replies

3. UNIX for Dummies Questions & Answers

Help parsing a XML file ....

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)
Discussion started by: misak
6 Replies

4. Shell Programming and Scripting

Random XML Parsing - using Perl

Given the XML: <?xml version="1.0" encoding="UTF-8"?> <reference> <refbody> <section> <p> <ul> <li><xref href="file1.dita#anchor" /></li> <li><xref href="file2.dita#anchor" /></li> </ul> </p> </section> <section> <p> <xref href="file3.dita#anchor" /> </p> <p> <xref... (4 Replies)
Discussion started by: ricksj
4 Replies

5. Shell Programming and Scripting

Bash XML Parsing using Perl XPath

I have a bash script that needs to read input from an XML file, which includes varying numbers of a certain type of child node. I want to be able to iterate through all the child nodes of a given parent. I installed the Perl XML-XPath package from search.cpan.org. Once it's installed, from bash,... (4 Replies)
Discussion started by: jfmorales
4 Replies

6. Shell Programming and Scripting

parsing xml file

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)
Discussion started by: annar
9 Replies

7. Shell Programming and Scripting

parsing XML result by using perl?

for some reasons, i need to parse the XML result by using perl. for instance, this is a sample XML result: <Response> <status>success</status> <answer>AAA::AAA</answer> <answer>BBB::BBB</answer> </Response> then i can use this way : my @output = (); foreach my $parts (@all) ##@all... (2 Replies)
Discussion started by: tiger2000
2 Replies

8. Shell Programming and Scripting

XML: parsing of the Google contacts XML file

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)
Discussion started by: ripat
9 Replies

9. UNIX for Dummies Questions & Answers

Parsing XML file

I want to parse xml file sample file....... <name locale="en">my_name<>/name><lastChanged>somedate</lastChanged><some more code here> <name locale="en">tablename1<>/name><lastChanged>somedate</lastChanged> <definition><dbquery><sources><sql type="cognos">select * from... (10 Replies)
Discussion started by: ms2001
10 Replies

10. Shell Programming and Scripting

Help with parsing xml file

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
UNR(9)							   BSD Kernel Developer's Manual						    UNR(9)

NAME
new_unrhdr, delete_unrhdr, alloc_unr, alloc_unr_specific, free_unr -- kernel unit number allocator SYNOPSIS
#include <sys/systm.h> struct unrhdr * new_unrhdr(int low, int high, struct mtx *mutex); void delete_unrhdr(struct unrhdr *uh); int alloc_unr(struct unrhdr *uh); int alloc_unrl(struct unrhdr *uh); int alloc_unr_specific(struct unrhdr *uh, u_int item); void free_unr(struct unrhdr *uh, u_int item); DESCRIPTION
The kernel unit number allocator is a generic facility, which allows to allocate unit numbers within a specified range. new_unrhdr(low, high, mutex) Initialize a new unit number allocator entity. The low and high arguments specify minimum and maximum number of unit numbers. There is no cost associated with the range of unit numbers, so unless the resource really is finite, INT_MAX can be used. If mutex is not NULL, it is used for locking when allocating and freeing units. Otherwise, internal mutex is used. delete_unrhdr(uh) Destroy specified unit number allocator entity. alloc_unr(uh) Return a new unit number. The lowest free number is always allocated. This function does not allocate memory and never sleeps, how- ever it may block on a mutex. If no free unit numbers are left, -1 is returned. alloc_unrl(uh) Same as alloc_unr() except that mutex is assumed to be already locked and thus is not used. alloc_unr_specific(uh, item) Allocate a specific unit number. This function allocates memory and thus may sleep. The allocated unit number is returned on suc- cess. If the specified number is already allocated or out of the range, -1 is returned. free_unr(uh, item) Free a previously allocated unit number. This function may require allocating memory, and thus it can sleep. There is no pre-locked variant. CODE REFERENCES
The above functions are implemented in sys/kern/subr_unit.c. HISTORY
Kernel unit number allocator first appeared in FreeBSD 6.0. AUTHORS
Kernel unit number allocator was written by Poul-Henning Kamp. This manpage was written by Gleb Smirnoff. BSD
July 5, 2010 BSD
All times are GMT -4. The time now is 07:19 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy