Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Extracting data between continuous non empty xml tags Post 302955125 by zen01234 on Monday 14th of September 2015 05:36:42 PM
Old 09-14-2015
I tried these commands, it worked!
1st command
sed -n '/phone/{s/.*<phone>\(.*\)<\/phone>.*/\1/;p}' file1 > file2

I got below output:
|<number>0000000000</number>|<type>primary</type>|

2nd command
awk -F '[<>]' '{n = split($3,array," "); print array[n] >> "file3" }' file2

I got the expected output:
1234567890
2345678999
3214325432
9876543210
4567896789
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extracting Data from xml file

Hi ppl out there... Can anyone help me with the shell script to extract data from an xml file. My xml file looks like : - <servlet> <servlet-name>FrontServlet</servlet-name> <display-name>FrontServlet</display-name> ... (3 Replies)
Discussion started by: nishana
3 Replies

2. Shell Programming and Scripting

how to get data from xml files tags(from data tags)

i have a file like <fruits> <apple>redcolor<\apple> <bana:rolleyes:na>yellow color and it is<\banana> </fruits> i need a text between apple and bannana ans so on.... how to read a text between a tags it multiple tags with differnt names (9 Replies)
Discussion started by: pvr_satya
9 Replies

3. Shell Programming and Scripting

How to update data between xml tags

Is there a way to modify Non Null data between <host> and </host> tags to a new value ?- may be using sed/awk? I tried this sed 's|.*<host>\(?*\)</host>.*|\<host>xxx</host>|' but it is updating the host which has null value - want opposite of this - Thanks in advance for you help!! For... (2 Replies)
Discussion started by: harry_todd
2 Replies

4. Shell Programming and Scripting

Extracting data between tags based on search string from unix file

Input file is on Linux box and the input file has data in just one line with 1699741696 characters. Sample Input: <xxx><document coll="uspatfull" version="0"><CMSdoc>xxxantivirus</CMSdoc><tag1>1</tag1></document><document coll="uspatfull"... (5 Replies)
Discussion started by: gaya
5 Replies

5. UNIX for Dummies Questions & Answers

Extracting data from an xml file

Hello, Please can someone assist. I have the following xml file: <?xml version="1.0" encoding="utf-8" ?> - <PUTTRIGGER xmlns:xsd="http://www.test.org/2001/XMLSchema" xmlns:xsi="http://www.test.org/2001/XMLSchema-instance" APPLICATIONNUMBER="0501160" ACCOUNTNAME="Mrs S Test"... (15 Replies)
Discussion started by: Dolph
15 Replies

6. Shell Programming and Scripting

Need help in extracting data from xml file

Hello, This is my first post in here, so excuse me if I sound too noob here! I need to extract the path "/apps/mp/installedApps/V61/HRO/hrms_01698_A_qa.ear" from the below xml extract. The path will always appear with the key "binariesURL" <deployedObject... (6 Replies)
Discussion started by: abhishek2386
6 Replies

7. Shell Programming and Scripting

Extracting Data between Tags with square Brackets

Hello @all, first, sorry for my bad english language. I try to extract with bash an text inside of a html page witch is finding between two tags. There is only one Tag in this file. Here is an example: Wert... (2 Replies)
Discussion started by: hennerich
2 Replies

8. Shell Programming and Scripting

Data between XML Tags

<?xml version="1.0" encoding="iso-8859-1" ?> <TABLE> <TEST> <ID> 123 </ID> <name> abc </name> </TEST> <TEST> <ID> 123 </ID> <name> abc2 </name> </TEST> </TABLE> <TABLE> <TEST> <ID> 456 </ID> <name> def </name> </TEST> <TEST> ... (8 Replies)
Discussion started by: eskay
8 Replies

9. Shell Programming and Scripting

print xml data without the tags.

Hi All, I'm trying to extract data from an xml file but without the codes. I've achieved it but i was wondering if there's a better way to do this. sample data: $ cat xmlfile <code> <to>tove</to> <from>jani</from> <heading>reminder</heading> <body>dont forget me</body> </code> ... (4 Replies)
Discussion started by: Irishboy24
4 Replies

10. Shell Programming and Scripting

Need Help in extracting data from XML File

Hi All My input file is an XML and it has some tags and data rows at end. Starting of data rows is <rs:data> and ending of data rows is </rs:data>. Within sample data rows (2 rows) shown below, I want to extract data value after equal to sign (until space or "/" sign). So if XML data... (7 Replies)
Discussion started by: vx04
7 Replies
TIDY_GET_CONFIG(3)							 1							TIDY_GET_CONFIG(3)

tidy::getConfig - Get current Tidy configuration

       Object oriented style

SYNOPSIS
array tidy::getConfig (void ) DESCRIPTION
Procedural style array tidy_get_config (tidy $object) Gets the list of the configuration options in use by the given tidy $object. PARAMETERS
o $object - The Tidy object. RETURN VALUES
Returns an array of configuration options. For an explanation about each option, visit http://tidy.sourceforge.net/docs/quickref.html. EXAMPLES
Example #1 tidy_get_config(3) example <?php $html = '<p>test</p>'; $config = array('indent' => TRUE, 'output-xhtml' => TRUE, 'wrap' => 200); $tidy = tidy_parse_string($html, $config); print_r($tidy->getConfig()); ?> The above example will output: Array ( [indent-spaces] => 2 [wrap] => 200 [tab-size] => 8 [char-encoding] => 1 [input-encoding] => 3 [output-encoding] => 1 [newline] => 1 [doctype-mode] => 1 [doctype] => [repeated-attributes] => 1 [alt-text] => [slide-style] => [error-file] => [output-file] => [write-back] => [markup] => 1 [show-warnings] => 1 [quiet] => [indent] => 1 [hide-endtags] => [input-xml] => [output-xml] => 1 [output-xhtml] => 1 [output-html] => [add-xml-decl] => [uppercase-tags] => [uppercase-attributes] => [bare] => [clean] => [logical-emphasis] => [drop-proprietary-attributes] => [drop-font-tags] => [drop-empty-paras] => 1 [fix-bad-comments] => 1 [break-before-br] => [split] => [numeric-entities] => [quote-marks] => [quote-nbsp] => 1 [quote-ampersand] => 1 [wrap-attributes] => [wrap-script-literals] => [wrap-sections] => 1 [wrap-asp] => 1 [wrap-jste] => 1 [wrap-php] => 1 [fix-backslash] => 1 [indent-attributes] => [assume-xml-procins] => [add-xml-space] => [enclose-text] => [enclose-block-text] => [keep-time] => [word-2000] => [tidy-mark] => [gnu-emacs] => [gnu-emacs-file] => [literal-attributes] => [show-body-only] => [fix-uri] => 1 [lower-literals] => 1 [hide-comments] => [indent-cdata] => [force-output] => 1 [show-errors] => 6 [ascii-chars] => 1 [join-classes] => [join-styles] => 1 [escape-cdata] => [language] => [ncr] => 1 [output-bom] => 2 [replace-color] => [css-prefix] => [new-inline-tags] => [new-blocklevel-tags] => [new-empty-tags] => [new-pre-tags] => [accessibility-check] => 0 [vertical-space] => [punctuation-wrap] => [merge-divs] => 1 ) SEE ALSO
tidy_reset_config(3), tidy_save_config(3). PHP Documentation Group TIDY_GET_CONFIG(3)
All times are GMT -4. The time now is 09:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy