there are N number of similar blocks within the same pattern in a single xml file with some other unnecessary text.
So first I have to extract these blocks into a single file and the finally
I need output like below into a file redirected
----like this
hope I have explained the whole scenario, please help
Thanks in advance
Last edited by Don Cragun; 05-29-2014 at 04:37 PM..
Reason: Add CODE tags AGAIN!
I agree with Akshay that your requirements are not clear.
It looks like you're saying that you have a file that contains blocks text where the first line in a block is:
and the last two lines in a block are:
For output you seem to want a list of comma separated lines using the data from the x XML tag in that block and lines where the 3rd field is "as" for each input block and you want the output blocks separated by the input block terminator with the leading spaces removed.
These are both pretty strange formats for an XML input file and for a CSV output file.
Please give us a clear description of your input file format and your output file format. (And use CODE tags so we can tell where leading and trailing spaces are present and where multiple adjacent spaces or tabs appear in your input and output.)
If you show us code that you have written to try to solve your problem it will help us understand what you're trying to do.
@ms2001 : if you just post sample data , what we have to think ? don't think that others will guess and answer you., from your last 2 sample it looks like you did not read Don Cragun's answer., without clear description we can't help.
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)
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)
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)
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)
I have a large xml file as shown below:
<input>
<blah>
<blah>
<atr="blah blah value = "">
<blah>
<blah>
</input>
..2nd chunk...
..3rd chunk...
...4th chunk...
All lines between <input> and </input> is one 'order' and this 'order' is repeated... (14 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)
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
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)
Hi All,
I have this(.xml) file as:
<!-- define your instance here -->
<instance name='ins_C2Londondev' user='' group='' fullname='B2%20-%20London%20(dev)' >
<property>
</property>
</instance>
I want output as:
<!-- define your instance here -->
<instance... (3 Replies)