Sponsored Content
Top Forums Shell Programming and Scripting Grep some values from XML file Post 302969993 by Lord Spectre on Thursday 31st of March 2016 05:58:58 AM
Old 03-31-2016
Well, first of all thanks for reply, what I need is the 3 red value in my previous example.
As I wrote COSID and TelephoneNumber is always present
In some case <WhoCalledOn> is not present so in the ouput should be reported NULL. In other cases TelephoneNumber rows is reported twice, so output I need is:
Code:
COSID='88',true,Value='393290439266',null
COSID='88',null,Value='393290439266',Value='393290439266'

So, in the first case the tag <WhoCalledOn> is present and the value is true.
In the second case the tag <WhoCalledOn> is not present so should be reported as null, plus, TelephoneNumber is reported twice. Something like:
Code:
<EntityIdentifiers>                   
<Identifier Type='TelephoneNumber' Value='324234231443'/>
<Identifier Type='TelephoneNumber' Value='324234231443'/>
</EntityIdentifiers>

Hope is clear,
thank you,
Lucas
 

9 More Discussions You Might Find Interesting

1. Programming

Extracting Field values for XML file

i have an input file of XML type with data like <nx-charging:additional-parameter name="NX_INTERNATIONALIZED_CLID" value="919427960829"/><nx-charging:finalStatus>RESPONSE , Not/Applicable , OK</nx-charging:finalStatus></nx-charging:process> i want to extract data such that i get the output... (3 Replies)
Discussion started by: junaid.nehvi
3 Replies

2. UNIX for Dummies Questions & Answers

Extracting values from an XML file

Hello People, I have an xml file from which I need to extract the values of the parameters using UNIX shell commands. Ex : Input is like : <Name>Roger</Name> or <Address>MI</Address> I need the output as just : Roger or MI with the tags removed. Please help. (1 Reply)
Discussion started by: sushant172
1 Replies

3. Shell Programming and Scripting

Extract values from an XML File

Hi, I need to capture all the attributes with delete next to it. The source XML file is attached. The output should contain something like this below: Attributes = legacyExchangeDN Action = Delete Username = Hero Joker Loginid = joker09 OU =... (4 Replies)
Discussion started by: prvnrk
4 Replies

4. Shell Programming and Scripting

Comparing delta values of one xml file in other xml file

Hi All, I have two xml files. One is having below input <NameValuePair> <name>Daemon</name> <value>tcp:7474</value> </NameValuePair> <NameValuePair> <name>Network</name> <value></value> </NameValuePair> ... (2 Replies)
Discussion started by: sharsour
2 Replies

5. UNIX for Dummies Questions & Answers

Reading XML file and print the values in the text file using Linux shell script

hi guys, i want help... Reding XML file and print the values into the text file using linux shell script file as per below xml file <sequence> <Filename>aldorzum.doc</Filename> <DivisionCode>US</DivisionCode> <ContentType>Template</ContentType> <ProductCode>VIMZIM</ProductCode> </sequence>... (1 Reply)
Discussion started by: sravanreddy
1 Replies

6. UNIX for Dummies Questions & Answers

Reading Xml file and print the values into the text file in columnwise?

hi guys, i want help... Reding XML file and print the values into the text file using linux shell script file as per below xml file <sequence> <Filename>aldorzum.doc</Filename> <DivisionCode>US</DivisionCode> <ContentType>Template</ContentType> <ProductCode>VIMZIM</ProductCode> </sequence>... (4 Replies)
Discussion started by: sravanreddy
4 Replies

7. Shell Programming and Scripting

How to retrieve values from XML file and update them in the same position! PLEASE HELP?

Good Day All Im quiet new to ksh scripting and need a bit of your help. I am attempting to write a script that reads in an XML and extracts certain field values from an XML file. The values are all alphanumeric and consist of two components: e.g "Test 1". I need to to create a script that... (2 Replies)
Discussion started by: JulioAmerica
2 Replies

8. UNIX for Beginners Questions & Answers

How to change values in xml file?

I have xml file like below, i want change the values at default-value place of each argument name using shell script. like where argument name= protocol and default-value=tcp, where argument name =port and default-value= 7223, where argument name = username and default-value=test, example ... (12 Replies)
Discussion started by: s1s2s3s4
12 Replies

9. Shell Programming and Scripting

Extract values from xml file script

Hi, please help on this. I want extract values of xml file structure and print in determined way. <ProjectName> --> only appears once <StructList> --> is the top node <Struct> node --> could be more than 1 NameID, STX, STY, PRX, PRY --> appears only 1 time within each <Struct> node... (10 Replies)
Discussion started by: Ophiuchus
10 Replies
XMLMERGE(1)															       XMLMERGE(1)

NAME
xmlmerge - Command line tool for merging XML snippets from multiple files SYNOPSIS
xmlmerge [options] <input file(s)> DESCRIPTION
The xmlmerge command collects XML snippets scattered to multiple files and merges them into one big XML tree. This tool is used by the build process of AqBanking to merge HBCI segment definitions from several files into one big XML file. OPTIONS
--compact Try to keep the merged XML data compact. --header Add a XML header to the merged XML data. --help, -h Output a short usage hint. --logfile LOGFILE Write log messages to the file LOGFILE. You need to select the logging type "logfile" for this option having any impact. See also option "--logtype" for more information. --loglevel LOGLEVEL Select the desired log level. Valid values are emergency, alert, critical, error, warning, notice, info, debug and verbous. --logtype LOGTYPE Select the desired logging type. Valid values are console, file and syslog. -o OUTFILE Write the resulting XML tree to the file OUTFILE. If this option is omitted the result is written to the standard output. -v enable verbose output. --version -V: Output the version of the xmlmerge tool. BUGS
There are now known bugs at the time of writing this manual page. COPYING
Copyright (C) Martin PreuB. Free use of this software is granted under the terms of the Lesser GNU Public License (LGPL). The manpage was composed by Micha Lenk and converted by the nifty tool AsciiDoc into a manpage. AUTHOR
Micha Lenk <micha@lenk.info> Author. 05/10/2012 XMLMERGE(1)
All times are GMT -4. The time now is 09:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy