Sponsored Content
Top Forums Shell Programming and Scripting Extract strings from XML files and create a new XML Post 302946776 by RudiC on Friday 12th of June 2015 05:14:50 AM
Old 06-12-2015
Better, but still a bit vague. For EXACTLY your setup, this might work:
Code:
grep -iE "$(tr -d "'" <C:/temp/input.txt | tr '\n' '|')header|footer" C:/temp/output.txt
<Header>My favorite restaurant</Header>
         <name>Belgian Waffles</name>
         <description>Two of our famous Belgian Waffles with plenty of real maple syrup</description>
         <name>Strawberry Belgian Waffles</name>
         <description>Light Belgian waffles covered with strawberries and whipped cream</description>
         <name>Berry-Berry American Pie</name>
         <description>Light American Pie covered with an assortment of fresh berries and whipped cream</description>
<Footer>My favorite restaurant</Footer>

Redirect to C:/temp/output.xml if happy.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Parse an XML task list to create each task.xml file

I have an task definition listing xml file that contains a list of tasks such as <TASKLIST <TASK definition="Completion date" id="Taskname1" Some other <CODE name="Code12" <Parameter pname="Dog" input="5.6" units="feet" etc /Parameter> <Parameter... (3 Replies)
Discussion started by: MissI
3 Replies

2. Shell Programming and Scripting

Perl script for extract data from xml files

Hi All, Prepare a perl script for extracting data from xml file. The xml data look like as AC StartTime="1227858839" ID="88" ETime="1227858837" DSTFlag="false" Type="2" Duration="303" /> <AS StartTime="1227858849" SigPairs="119 40 98 15 100 32 128 18 131 23 70 39 123 20 120 27 100 17 136 12... (3 Replies)
Discussion started by: allways4u21
3 Replies

3. Windows & DOS: Issues & Discussions

Renaming files with strings from xml tags

Hello! I need to rename 400+ xml files. The name of the specific file is contained in a xml tag in the file itself. The batch file should rename all these files with strings found in xml tags. Every xml file has the following tags: <footnote><para>FILENAME</para></footnote> I have to get... (3 Replies)
Discussion started by: degoor
3 Replies

4. Programming

extract xml data and create word document using perl.

hi, i have large xml file which contains students information, i need to extract student number and some address tags and create a word document for the extracted data. my data looking llike this <student> <number>24</number> <education>bachelors</education> ... (1 Reply)
Discussion started by: veerubiji
1 Replies

5. Programming

Extract xml data and create word document using perl.

Hi, I have large xml data file.I need to extract node and some tags in the node and after I need to create word document. my XMl data is look like as below -<student> <number>24</number> <education>bachelor</bachelor> <specialization>computers</specialization> ... (3 Replies)
Discussion started by: veerubiji
3 Replies

6. Shell Programming and Scripting

Extract strings within XML file between different delimiters

Good afternoon! I have an XML file from which I want to extract only certain elements contained within each line. The problem is that the format of each line is not exactly the same (though similiar). For example, oa_var will be in each line, however, there may be no value or other... (3 Replies)
Discussion started by: bab@faa
3 Replies

7. Shell Programming and Scripting

Compare two xml files while ignoring some xml tags

I've got two different files and want to compare them. File 1 : <response ticketId="944" type="getQueryResults"><status>COMPLETE</status><description>Query results fetched successfully</description><recordSet totalCount="1" type="sms_records"><record id="38,557"><columns><column><name>orge... (2 Replies)
Discussion started by: Shaishav Shah
2 Replies

8. Shell Programming and Scripting

Extract a particular xml only from an xml jar file

Hi..need help on how to extract a particular xml file only from an xml jar file... thanks! (2 Replies)
Discussion started by: qwerty000
2 Replies

9. Shell Programming and Scripting

Splitting xml file into several xml files using perl

Hi Everyone, I'm new here and I was checking this old post: /shell-programming-and-scripting/180669-splitting-file-into-several-smaller-files-using-perl.html (cannot paste link because of lack of points) I need to do something like this but understand very little of perl. I also check... (4 Replies)
Discussion started by: mcosta
4 Replies

10. Shell Programming and Scripting

Splitting a single xml file into multiple xml files

Hi, I'm having a xml file with multiple xml header. so i want to split the file into multiple files. Sample.xml consists multiple headers so how can we split these multiple headers into multiple files in unix. eg : <?xml version="1.0" encoding="UTF-8"?> <ml:individual... (3 Replies)
Discussion started by: Narendra921631
3 Replies
DH_INSTALLXMLCATALOGS(1)					     Debhelper						  DH_INSTALLXMLCATALOGS(1)

NAME
dh_installxmlcatalogs - install and register XML catalog files SYNOPSIS
dh_installxmlcatalogs [debhelper options] [-n] DESCRIPTION
dh_installxmlcatalogs is a debhelper program that installs and registers XML catalog files. It complies with the Debian XML/SGML policy. The file debian/package.xmlcatalogs lists the local XML catalog files to be installed per package as well as the XML entities in those local XML catalog files that are to be registered in the XML catalog system. The local XML catalog file entries in that file should be of the form "local;source;dest", where the verbatim "local" indicates this is an entry for a local XML catalog file, "source" indicates where the local XML catalog resides in the source tree, and "dest" indicates the destination location for the local XML catalog under the package build area. "dest" should start with /usr/share/xml/. The entries for the XML entities to be registered in the package XML catalog file should be of the form "package;type;id;catalog", where the verbatim "package" indicates this is an entry for an XML entity to be registered in the package XML catalog file, "type" indicates the XML entity type (public, system, uri), "id" indicates the XML entity id, and "catalog" indicates the local XML catalog file. The entries for the XML entities to be registered in the root XML catalog file should be of the form "root;type;id", where the verbatim "root" indicates this is an entry for an XML entity to be registered in the root XML catalog file, "type" indicates the XML entity type (public, system, uri), and "id" indicates the XML entity id. If an entry for is to be registered identically in the root catalog and the package catalog file, you can use the form "root-and-package;type;id;catalog", where the verbatim "root-and-package" indicates this is an entry for an XML entity to be registered in both the root and package XML catalog files, "type" indicates the XML entity type (public, system, uri), "id" indicates the XML entity id, and "catalog" indicates the local XML catalog file. XML entity types are described in update-xmlcatalog(8). Using the "root" or "package" commands, a type of "public" will general "delegatePublic" statements in the applicable catalog file. Generally you will want to use the types "public" for any formal public identifiers, and "system" for any files on the local filesystem or URLs. "uri" is only used for non-local files which are not part of the external document subset, e.g., they are not used for entities or DTDs. dh_installxmlcatalogs automatically adds maintainer script snippets for the registration and unregistration of the listed XML entities in the XML catalog system (unless -n is used). A dependency on the xml-core package will be added to "${misc:Depends}", so be sure to use that variable in the file debian/control. See dh_installdeb(1) for an explanation of Debhelper maintainer script snippets. OPTIONS
-n, --noscripts Do not modify postinst/postrm/prerm scripts. NOTES
Note that this command is not idempotent. "dh_clean -k" should be called between invocations of this command. Otherwise, it may cause multiple instances of the same text to be added to maintainer scripts. SEE ALSO
debhelper(7) /usr/share/doc/xml-core/ AUTHOR
Ardo van Rangelrooij <ardo@debian.org> Adam Di Carlo <aph@debian.org> perl v5.14.2 2012-09-10 DH_INSTALLXMLCATALOGS(1)
All times are GMT -4. The time now is 07:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy