Sponsored Content
Top Forums Shell Programming and Scripting Extract selective block from XML file Post 302485044 by dips_ag on Tuesday 4th of January 2011 04:27:37 AM
Old 01-04-2011
Hi Scrutinizer,

Neat. It worked perfectly fine!! Thankyou.

This kind of "awk" construct means that the lines between FROM KEYWORD & TO KEYWORD be selected. Am I right?
Code:
 
awk '/FROM KEYWORD/,/TO KEYWORD/' infile

-dips
 

10 More Discussions You Might Find Interesting

1. 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

2. Shell Programming and Scripting

extract a number within an xml file

Hi Everyone, I have an sh script that I am working on and I have run into a little snag that I am hoping someone here can assist me with. I am using wget to retrieve an xml file from thetvdb.com. This part works ok but what I need to be able to do is extract the series ID # from the xml and put... (10 Replies)
Discussion started by: tret
10 Replies

3. 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

4. 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

5. Shell Programming and Scripting

Get extract text from xml file

Hi Collegue, i have a file say a.xml. it has contents <bpelFault><faultType>1</faultType><genericSystemFault xmlns=""><part name="payload"><v2:Fault... (10 Replies)
Discussion started by: Jewel
10 Replies

6. 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

7. UNIX for Dummies Questions & Answers

Extract Element from XML file

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

8. Shell Programming and Scripting

How can I extract XML block around matching search string?

I want to extract XML block surrounding search string Ex: print XML block for string "myapp1-ear" surrounded by "<application> .. </application>" Input XML: <?xml version="1.0" encoding="UTF-8"?> <deployment-request> <requestor> <first-name>kchinnam</first-name> ... (16 Replies)
Discussion started by: kchinnam
16 Replies

9. 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

10. UNIX for Beginners Questions & Answers

Extract XML block when value is matched (Shell script)

Hi everyone, So i'm struggling with an xml (log file) where we get information about some devices, so the logfile is filled with multiple "blocks" like that. Based on the <devId> i want to extract this part of the xml file. If possible I want it to have an script for this, cause we'll use... (5 Replies)
Discussion started by: Pouky
5 Replies
VPDDECODE(8)						      System Manager's Manual						      VPDDECODE(8)

NAME
vpddecode - VPD structure decoder SYNOPSIS
vpddecode [OPTIONS] DESCRIPTION
vpddecode prints the "vital product data" information that can be found in almost all IBM and Lenovo computers. Available items are: o BIOS Build ID o Box Serial Number o Motherboard Serial Number o Machine Type/Model Some systems have these additional items: o BIOS Release Date o Default Flash Image File Name Note that these additional items are not documented by IBM, so this is guess work, and as such should not be blindly trusted. Feedback about the accuracy of these labels is welcome. OPTIONS
-d, --dev-mem FILE Read memory from device FILE (default: /dev/mem) -s, --string KEYWORD Only display the value of the VPD string identified by KEYWORD. KEYWORD must be a keyword from the following list: bios-build-id, box-serial-number, motherboard-serial-number, machine-type-model, bios-release-date. Each keyword corresponds to an offset and a length within the VPD record. Not all strings may be defined on all VPD-enabled systems. If KEYWORD is not provided or not valid, a list of all valid keywords is printed and vpddecode exits with an error. This option cannot be used more than once. Mutually exclusive with --dump. -u, --dump Do not decode the VPD records, dump their contents as hexadecimal instead. Note that this is still a text output, no binary data will be thrown upon you. ASCII equivalent is displayed when possible. This option is mainly useful for debugging. Mutually exclu- sive with --string. -h, --help Display usage information and exit -V, --version Display the version and exit FILES
/dev/mem AUTHOR
Jean Delvare SEE ALSO
biosdecode(8), dmidecode(8), mem(4), ownership(8) dmidecode February 2007 VPDDECODE(8)
All times are GMT -4. The time now is 10:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy