Extract a particular xml only from an xml jar file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Extract a particular xml only from an xml jar file
# 1  
Old 05-08-2013
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  
Old 05-08-2013
You could easily determine how to do this by referring to the man page - jar(1).

i.e.
Code:
jar xf jarfile file-to-extract

# 3  
Old 05-09-2013
Thank you Scott!
Using the above command all the xml files in the jar are getting extracted on the unix box whereas I want contents of just one xml(that matches a pattern) from the jar to be written in a file on the box.

For e.g:
20130508.abc.jar is the jar file that has the following xmls:
/archiveDir/pqr_1234567890.xml
/archiveDir/abc_4444444444.xml
/archiveDir/def_5555555555.xml

I want the contents of say... abc_4444444444.xml only written in an xml on my box, which is under the "archiveDir" directory. I do not want all the jar files extracted, just this one: abc_4444444444.xml

Can you please help me with this..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extract a value from an xml file

I have this XML file format and all in one line: Fri Dec 23 00:14:52 2016 Logged Message:689|<?xml version="1.0" encoding="UTF-8"?><PORT_RESPONSE><HEADER><ORIGINATOR>XMG</ORIGINATOR><DESTINAT... (16 Replies)
Discussion started by: mrn6430
16 Replies

2. Shell Programming and Scripting

Extract strings from XML files and create a new XML

Hello everybody, I have a double mission with some XML files, which is pretty challenging for my actual beginner UNIX knowledge. I need to extract some strings from multiple XML files and create a new XML file with the searched strings.. The original XML files contain the source code for... (12 Replies)
Discussion started by: milano.churchil
12 Replies

3. UNIX for Dummies Questions & Answers

Extract Element from XML file

<?xml version = '1.0' encoding =... (8 Replies)
Discussion started by: Siva SQL
8 Replies

4. Shell Programming and Scripting

Extract Data from XML file.

Hi Guys, I am in a need to extract data from a xml file. The XML file format is as below. <data jsxnamespace="propsbundle" locales=""> <locale> <!--Error messages starts--> <record jsxid="CHARPAIR001" jsxtext=" must be selected"></record> <record... (1 Reply)
Discussion started by: Showdown
1 Replies

5. Shell Programming and Scripting

Extract data from XML file

Hi , I have input file as XML. following are input data #complex.xml <?xml version="1.0" encoding="UTF-8"?> <TEST_doc xmlns="http://www.w3.org/2001/XMLSchema-instance"> <ENTRY uid="123456"> <protein> <name>PROT001</name> <organism>Human</organism> ... (1 Reply)
Discussion started by: mohan sharma
1 Replies

6. Shell Programming and Scripting

extract a pattern from a xml file

Hello All, I want to write a shell script for extracting a content from a xml file the xml file looks like this: <Variable name="moreAxleInfo"> <type> <Table> <type> <NamedType> <type> <TypeRef... (11 Replies)
Discussion started by: suvendu4urs
11 Replies

7. Shell Programming and Scripting

Extract a pattern from xml file

Hi, In a single line I have the below xml content <lst name="responseHeader"><int name="status">0</int><int name="QTime">1</int></lst><lst name="status"><lst name=""><str name="name"/><str name="instanceDir">/var/www/search/current/Search/solr/./</str><str... (5 Replies)
Discussion started by: ashokvpp
5 Replies

8. Shell Programming and Scripting

Extract details from XML file

Hi , I have one xml file contains more than 60 lines. I need to extract some details from the file and store it in new file.Not the whole file Please find the xml file below: <?xml version="1.0" encoding="UTF-8"?> <DeploymentDescriptors xmlns="http://www.tibco.com/xmlns/dd"> ... (6 Replies)
Discussion started by: ckchelladurai
6 Replies

9. UNIX for Dummies Questions & Answers

Extract Field Value from XML file

Hi, Within a UNIX shell script I need to extract a value from an XML field. The field will contain different values but will always be 6 digits in length. E.g.: <provider-id>999999</provider-id> I've tried various ways but no luck. Any ideas how I might get the provider id (in this case... (2 Replies)
Discussion started by: pnclayt11
2 Replies

10. Shell Programming and Scripting

How to extract text from xml file

I have some xml files that got created by exporting a website from RedDot. I would like to extract the cost, course number, description, and meeting information. <?xml version="1.0" encoding="UTF-16" standalone="yes" ?> - <PAG PAG0="3AE6FCFD86D34896A82FCA3B7B76FF90" PAG3="525312"... (3 Replies)
Discussion started by: chrisf
3 Replies
Login or Register to Ask a Question