Sponsored Content
Full Discussion: GREP for a tag in XML File
Top Forums UNIX for Dummies Questions & Answers GREP for a tag in XML File Post 302838369 by bartus11 on Monday 29th of July 2013 12:11:01 PM
Old 07-29-2013
Try:
Code:
perl -nle '/<PARTICIPATION_TYPE>.*?<\/PARTICIPATION_TYPE>/ && print $&' file.xml

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

XML tag replacement from different XML file

We have 2 XML file 1. ORIGINAL.xml file and 2. ATTRIBUTE.xml files, In the ORIGINAL.xml we need some modification as <resourceCode>431048</resourceCode>under <item type="Manufactured"> tag - we need to grab the 431048 value from tag and pass it to database table in unix shell script to find the... (0 Replies)
Discussion started by: balrajg
0 Replies

2. Shell Programming and Scripting

Changing particular tag value of xml file

Hi All, I have number of xml file like : ______________________________________________________ <?xml version="1.0" standalone="no"?> <!-- Created by Symology Ltd on 13/02/2012 - USER_BATCH_ID 0011091684 --> <!-- RECIPIENT_URL: HTTP://194.168.0.81:3408 --> <EToNrequest ... (7 Replies)
Discussion started by: krsnadasa
7 Replies

3. Shell Programming and Scripting

How to retrieve the value from XML tag whose end tag is in next line

Hi All, Find the following code: <Universal>D38x82j1JJ </Universal> I want to retrieve the value of <Universal> tag as below: Please help me. (3 Replies)
Discussion started by: mjavalkar
3 Replies

4. Shell Programming and Scripting

How to add the multiple lines of xml tags before a particular xml tag in a file

Hi All, I'm stuck with adding multiple lines(irrespective of line number) to a file before a particular xml tag. Please help me. <A>testing_Location</A> <value>LA</value> <zone>US</zone> <B>Region</B> <value>Russia</value> <zone>Washington</zone> <C>Country</C>... (0 Replies)
Discussion started by: mjavalkar
0 Replies

5. Shell Programming and Scripting

Extract XML tag value from file

Hello, Hope you are doing fine. I have an log file which looks like as follows: Some junk text1 Date: Thu Mar 15 13:38:46 CDT 2012 DATA SENT SUCCESSFULL: Some jun text 2 Date: Thu Mar 15 13:38:46 CDT 2012 DATA SENT SUCCESSFULL: ... (3 Replies)
Discussion started by: srattani
3 Replies

6. Shell Programming and Scripting

To search for a particular tag in xml and collate all similar tag values and display them count

I want to basically do the below thing. Suppose there is a tag called object1. I want to display an output for all similar tag values under heading of Object 1 and the count of the xmls. Please help File: <xml><object1>house</object1><object2>child</object2>... (9 Replies)
Discussion started by: srkmish
9 Replies

7. Shell Programming and Scripting

Extracting the tag name from an xml file

Hi, My requirement is something like this, I have a xml file that contains some tags and nested tags, <n:tag_name1> <n:sub_tag1>val1</n:sub_tag1> <n:sub_tag2>val2</n:sub_tag2> </n:tag_name1> <n:tag_name2> <n:sub_tag1>value</n:sub_tag1> ... (6 Replies)
Discussion started by: Little
6 Replies

8. Shell Programming and Scripting

Update particular tag in a XML file

Below is the content in my XML file <name>XXX</name> <eventType>Uptime</eventType> <eventType>Delay</eventType> <eventType>Delay</eventType> <name>YYY</name> <eventType>Uptime</eventType> <eventType>Delay</eventType> ... (12 Replies)
Discussion started by: Viswanatheee55
12 Replies

9. Shell Programming and Scripting

Moving XML tag/contents after specific XML tag within same file

Hi Forum. I have an XML file with the following requirement to move the <AdditionalAccountHolders> tag and its content right after the <accountHolderName> tag within the same file but I'm not sure how to accomplish this through a Unix script. Any feedback will be greatly appreciated. ... (19 Replies)
Discussion started by: pchang
19 Replies

10. UNIX for Beginners Questions & Answers

Grepping multiple XML tag results from XML file.

I want to write a one line script that outputs the result of multiple xml tags from a XML file. For example I have a XML file which has below XML tags in the file: <EMAIL>***</EMAIL> <CUSTOMER_ID>****</CUSTOMER_ID> <BRANDID>***</BRANDID> Now I want to grep the values of all these specified... (1 Reply)
Discussion started by: shubh752
1 Replies
docb_gen(3erl)						     Erlang Module Definition						    docb_gen(3erl)

NAME
docb_gen - Generate XML from EDoc comments in Erlang source code. DESCRIPTION
docb_gen contains functions for generating XML documentation source code according to the erlref or chapter DTD from EDoc comments in Erlang source code or an overview.edoc file, using EDoc. EXPORTS
module(File) -> ok | {error, Reason} module(File, Options) -> ok | {error, Reason} Types File = string() Options = [Opt] Opt = {def,Defs} | {includes,Dirs} | {preprocess,Bool} | {sort_functions,Bool} Defs = [{atom(),string()}] Dirs = [string()] Bool = bool() Reason = badfile | {badopt,term()} | term() Generates XML documentation source code according to the erlref DTD from EDoc comments File , using the EDoc application. File is an Erlang source file, given with or without the .erl extension as Name.erl or Name . The resulting XML file is created in the current working directory and named Name.xml . Options is a list of options, see below. Returns ok if successful, and an error tuple otherwise. users_guide(File) -> ok | {error, Reason} users_guide(File, Options) -> ok | {error, Reason} Types File -- see module/1,2 Options -- see module/1,2 Reason -- see module/1,2 Like module/1,2 but generates XML source code according to the chapter DTD from an overview.edoc or similar file. The resulting file is named chapter.xml . OPTIONS
{def, [{Name,Text}]} : Specifies EDoc macro definitions. See edoc:get_doc/2 . {includes, [Dir]} : Specifies directories where EDoc should search for include files. See edoc:read_source/2 . {preprocess, true|false} : Specifies if EDoc should read the source file via the Erlang preprocessor. Default is false . See edoc:read_source/2 . {sort_functions, true|false} : Specifies if the functions in the resulting XML file should be sorted alphabetically. Default is true . LIMITATIONS
The mapping from the EDoc XHTML output to valid Erlang/OTP XML is not complete. An attempt has been made to cover the most commonly used XHTML constructs, but there will still be cases where XML generation fails or where the resulting XML is inadequate. This is especially true for users_guide/1,2 . Known limitations for some XHTML tags: <a> : All attributes except the first href or name attribute are ignored. A href attribute means the <a> tag will be transformed to a <seealso> or <url> tag and an attempt is made to resolve the reference if necessary. A name attribute means the <a> tag will be transformed to a <marker> tag. <b>, <em>, <pre> : Cannot contain other tags in Erlang/OTP XML, content is converted to plain text. <center> : No corresponding Erlang/OTP XML tag, converted to plain text. <font> : No corresponding Erlang/OTP XML tag, converted to plain text. <h1>, <h2>, ... : There is no tag corresponding to a header in Erlang/OTP XML, so these are converted to plain text instead, with the exception of <h3> and <h4> tags within overview.edoc , see part about " chapter DTD" below. <sup> : There is no tag corresponding to superscript in Erlang/OTP XML, so this is converted to plain text within brackets "(..)". References : The markers automatically inserted by EDoc at each heading and function will override the markers automatically inserted by DocBuilder, with the unfortunate result that the links in the left-hand frame of the User's Guide will not work, and also that cross referencing a function in a module the usual Erlang/OTP way " <seealso marker="edoc:edoc#run/3...> " does not work. (But " <seealso marker="edoc:edoc#run-3...> " does.) erlref DTD Tables : Tables are not allowed. The contents of a table is converted to text instead, each row corresponding to one line of text. chapter DTD Sections : Only two levels of sections. <h3> (equivalent to EDoc headings " == Heading == ") is interpreted as start of top-level section, or if there is no <h3> tag, the entire document is made into one top-level section. <h4> (equivalent to EDoc sub-headings (" === Sub-heading === ") is interpreted as start of second-level section. Tables : Tables without borders are converted to text in the same manner as for the erlref DTD. Ericsson AB docbuilder 0.9.8.9 docb_gen(3erl)
All times are GMT -4. The time now is 12:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy