Sponsored Content
Full Discussion: XML Parsing
Top Forums UNIX for Advanced & Expert Users XML Parsing Post 302601604 by manas_ranjan on Friday 24th of February 2012 06:27:58 AM
Old 02-24-2012
There is no xml header and footer for this xml.

As I already stated this xml is the filter out xml from original one(have header and footer) just to represent the layout.

vague idea:
Code:
1 remove all member items i.e. AllMember
2 in this requirement the headers of lyout are fixed like TOTAL+CB,CB+FX,CS,IR, TOTAL
3 all I need to find out consequent items falling under these mentioned header
let say for  array TOTAL+CB there are two items as DMFXNY, EMSGFX
       TOTAL+CB
           DMFXNY
       TOTAL+CB
            EMSGFX
similarly for CB+FX there are four items CB/DMFXNY ,CB/EMSGFX, FX/DMFXNY and FX/EMSGFX
          CB+FX
             CB
           DMFXNY
          CB+FX
             CB
          EMSGFX
          CB+FX
             FX
         DMFXNY
          CB+FX
             FX
              EMSGFX

to give the layout as below
Code:
 TOTAL+CB      |		 CB+FX		       |  CS		| IR	      |	 TOTAL	      |
-------------------------------------------------------------------------------------------------------
DMFXNY	EMSGFX |CB/DMFXNY CB/EMSGFX FX/DMFXNY FX/EMSGFX|DMFXNY	EMSGFX  |DMFXNY	EMSGFX|	DMFXNY	EMSGFX|

this is just vague idea, if you have better thought then please share?

---------- Post updated at 06:27 AM ---------- Previous update was at 04:30 AM ----------

now I sort out some more fields as per above requirement , now My file looks like as below , let's say I have a file like below
Code:
     TOTAL+CB
         DMFXNY
       TOTAL+CB
         EMSGFX
          CB+FX
             CB
         DMFXNY
          CB+FX
             CB
         EMSGFX
          CB+FX
             FX
         DMFXNY
          CB+FX
             FX
         EMSGFX
             CS
         DMFXNY
             CS
         EMSGFX
             IR
         DMFXNY
             IR
         EMSGFX
          TOTAL
         DMFXNY
          TOTAL
         EMSGFX

and now need to customise this file to look as below, so can anyone help me , how to ??
Code:
 TOTAL+CB      |		 CB+FX		       |  CS		| IR	      |	 TOTAL	      |
-------------------------------------------------------------------------------------------------------
DMFXNY	EMSGFX |CB/DMFXNY CB/EMSGFX FX/DMFXNY FX/EMSGFX|DMFXNY	EMSGFX  |DMFXNY	EMSGFX|	DMFXNY	EMSGFX|


Last edited by manas_ranjan; 02-24-2012 at 07:32 AM.. Reason: added layout
 

10 More Discussions You Might Find Interesting

1. Programming

XML parsing

Hi I want to take an XML file and transform it into a pipe-delimited format. What is the best tool to use for this? I have libxml2 which seems to be the best xml parser around. The xml file will have the following format. <Txn> <Date>120504</Date> <id>99</id> <Items> <Item>... (1 Reply)
Discussion started by: handak9
1 Replies

2. Shell Programming and Scripting

parsing xml

I want to use wget comment to parse an xml parse that exist in an online website. How can I connect it using shell script through Unix and how can I parse it?? (1 Reply)
Discussion started by: walnut
1 Replies

3. Shell Programming and Scripting

XML Parsing

Hi, Need a script to parse the following xml file content <tag1 Name="val1"> <abc Name="key"/> <abc Name="pass">*********</abc> </tag1> <tag2 Name="Core"> <Host Name="a.b.c"> <tag1 Name="abc"> <abc Name="ac">None</abc> ... (4 Replies)
Discussion started by: Mavericc
4 Replies

4. Shell Programming and Scripting

XML parsing

I have a xml file attached. I need to parse parameterId and its value My output should be like 151515 38 151522 32769 and so on.. Please help me. Its urgent (6 Replies)
Discussion started by: LavanyaP
6 Replies

5. Shell Programming and Scripting

Parsing XML

Learned People, Hello ! Till today, for the most part, all of the tricky questions/situations that I encountered were already posted by other folks and all I had to do was peruse through these one at a time and I could find some sort of an answer and all I had to do was add some minor tweaks... (5 Replies)
Discussion started by: ManoharMa
5 Replies

6. Shell Programming and Scripting

Parsing XML

I am trying to parse an xml file and trying to grab certain values and inserting them into database table. I have the following xml that I am parsing: <dd:service name="locator" link="false"> <dd:activation mode="manual" /> <dd:run mode="direct_persistent" proxified="false" managed="true"... (7 Replies)
Discussion started by: $criptKid617
7 Replies

7. 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

8. Shell Programming and Scripting

XML parsing

i have xml output in below format... <AlertsResponse> <Alert id="11216" name="fgdfg"> <AlertActionLog timestamp="1356521629778" user="admin" detail="Recovery Alert"/> </Alert> <Alert id="11215" name="gdfg <AlertActionLog timestamp="1356430119840" user=""... (12 Replies)
Discussion started by: vivek d r
12 Replies

9. Shell Programming and Scripting

XML Parsing :

HI I want to parse below file in to two output :- Input :- ?xml version="1.0" encoding="UTF-8"?> <bulkCmConfigDataFile xmlns:un="utranNrm.xsd" <configData dnPrefix="Undefined"> <xn:SubNetwork id="ONRM_ROOT_MO_R"> <xn:MeContext id="C136"> ... (3 Replies)
Discussion started by: asavaliya
3 Replies

10. Shell Programming and Scripting

XML parsing

I have an xml file where the format looks like below <SESSIONCOMPONENT REFOBJECTNAME ="pre_session_command" REUSABLE ="NO" TYPE ="Pre-session command"> <TASK DESCRIPTION ="" NAME ="pre_session_command" REUSABLE ="NO" TYPE ="Command" VERSIONNUMBER ="1"> ... (8 Replies)
Discussion started by: r_t_1601
8 Replies
TOTAL(1)						      General Commands Manual							  TOTAL(1)

NAME
total - sum up columns SYNOPSIS
total [ -m ][ -sE | -p | -u | -l ][ -i{f|d}[N] ][ -o{f|d} ][ -tC ][ -N [ -r ]] [ file .. ] DESCRIPTION
Total sums up columns of real numbers from one or more files and prints out the result on its standard output. By default, total computes the straigt sum of each input column, but multiplication can be specified instead with the -p option. Likewise, the -u option means find the upper limit (maximum), and -l means find the lower limit (minimum). Sums of powers can be computed by giving an exponent with the -s option. (Note that there is no space between the -s and the exponent.) This exponent can be any real number, positive or negative. The absolute value of the input is always taken before the power is computed in order to avoid complex results. Thus, -s1 will produce a sum of absolute values. The default power (zero) is interpreted as a straight sum without taking absolute values. The -m option can be used to compute the mean rather than the total. For sums, the arithmetic mean is computed. For products, the geomet- ric mean is computed. (A logarithmic sum of absolute values is used to avoid overflow, and zero values are silently ignored.) If the input data is binary, the -id or -if option may be given for 64-bit double or 32-bit float values, respectively. Either option may be followed immediately by an optional count, which defaults to 1, indicating the number of double or float binary values to read per record on the input file. (There can be no space between the option and this count.) Similarly, the -od and -of options specify binary double or float output, respectively. These options do not need a count, as this will be determined by the number of input channels. A count can be given as the number of lines to read before computing a result. Normally, total reads each file to its end before producing its result, but this behavior may be overridden by inserting blank lines in the input. For each blank input line, total produces a result as if the end-of-file had been reached. If two blank lines immediately follow each other, total closes the file and proceeds to the next one (after reporting the result). The -N option (where N is a decimal integer) tells total to produce a result and reset the calculation after every N input lines. In addition, the -r option can be specified to override reinitialization and thus give a running total every N lines (or every blank line). If the end of file is reached, the current total is printed and the calculation is reset before the next file (with or without the -r option). The -tC option can be used to specify the input and output tab character. The default tab character is TAB. If no files are given, the standard input is read. EXAMPLE
To compute the RMS value of colon-separated columns in a file: total -t: -m -s2 input To produce a running product of values from a file: total -p -1 -r input BUGS
If the input files have varying numbers of columns, mean values will certainly be off. Total will ignore missing column entries if the tab separator is a non-white character, but cannot tell where a missing column should have been if the tab character is white. AUTHOR
Greg Ward SEE ALSO
cnt(1), neaten(1), rcalc(1), rlam(1), tabfunc(1) RADIANCE
2/3/95 TOTAL(1)
All times are GMT -4. The time now is 04:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy