Sponsored Content
Top Forums Shell Programming and Scripting sed - extract text from xml file Post 302597304 by tarun_agrawal on Friday 10th of February 2012 12:24:44 AM
Old 02-10-2012
try this

Code:
 egrep -o '\$\{[^ ]+\}' filename

 

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

sed or awk to extract data from Xml file

Hi, I want to get data from Xml file by using sed or awk command. I want to get the following result : mon titre 1;Createur1;Dossier1 mon titre 1;Createur1;Dossier1 and save it in cvs file (fichier.cvs). FROM this Xml file (test.xml): <playlist version="1"> <trackList> <track>... (1 Reply)
Discussion started by: yeclota
1 Replies

3. Shell Programming and Scripting

SED extract XML value

I have the following string: <min-pool-size>2</min-pool-size> When I pipe the string into the following code I am expcting for it to return just the value "2", but its just reurning the whole string. Why?? sed -n '/<min-pool-size>/,/<\/min-pool-size>/p' Outputting:... (13 Replies)
Discussion started by: ArterialTool
13 Replies

4. Shell Programming and Scripting

Using SED/AWK to extract xml at end of file

Hello everyone, Firstly i do not require alot of help.. i am right at the end of finishing my scipt but cannot find a solution to the last part. What i need to do is, prompt the user for a file to work with, which i have done. promt the user for an output file - which is done. #!/bin/bash... (14 Replies)
Discussion started by: hugh86
14 Replies

5. Shell Programming and Scripting

Need help please with Grep/Sed command to extract text and numbers from a file

Hello All, I need to extract lines from a file that contains ALPHANUMERIC and the length of Alphanumeric is set to 16. I have pasted the sample of the lines from the text file that I have created. My problem is that sometimes 16 appears in other part of the line. I'm only interested to... (14 Replies)
Discussion started by: mnassiri
14 Replies

6. Shell Programming and Scripting

sed extract from xml

I have an xml file that generally looks like this: "<row><dnorpattern>02788920</dnorpattern><description/></row><row><dnorpattern>\+ 44146322XXXX</dnorpattern><description/></row><row><dnorpattern>40XXX</dnorpattern><description/></row><row><dnorpattern>11</dn... (4 Replies)
Discussion started by: garboon
4 Replies

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

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

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

How to write in other language in text/xml file by reading english text/xml file using C++?

Hello Team, I have 2 files.one contains english text and another contains Japanese. so i have to read english text and replace the text with Japanesh text in third file. Basically, I need a help to write japanese language in text/xml file.I heard wstring does this.Not sure how do i write... (2 Replies)
Discussion started by: SA_Palani
2 Replies
Test::XML::Simple(3pm)					User Contributed Perl Documentation				    Test::XML::Simple(3pm)

NAME
Test::XML::Simple - easy testing for XML SYNOPSIS
use Test::XML::Simple tests=>5; xml_valid $xml, "Is valid XML"; xml_node $xml, "/xpath/expression", "specified xpath node is present"; xml_is, $xml, '/xpath/expr', "expected value", "specified text present"; xml_like, $xml, '/xpath/expr', qr/expected/, "regex text present"; xml_is_deeply, $xml, '/xpath/expr', $xml2, "structure and contents match"; # Not yet implemented: # xml_like_deeply would be nice too... DESCRIPTION
"Test::XML::Simple" is a very basic class for testing XML. It uses the XPath syntax to locate nodes within the XML. You can also check all or part of the structure vs. an XML fragment. TEST ROUTINES
xml_valid $xml, 'test description' Pass an XML file or fragment to this test; it succeeds if the XML (fragment) is valid. xml_node $xml, $xpath, 'test description' Checks the supplied XML to see if the node described by the supplied XPath expression is present. Test fails if it is not present. xml_is_long $xml, $xpath, $value, 'test description' Finds the node corresponding to the supplied XPath expression and compares it to the supplied value. Succeeds if the two values match. Uses Test::More's "is" function to do the comparison. xml_is $xml, $xpath, $value, 'test description' Finds the node corresponding to the supplied XPath expression and compares it to the supplied value. Succeeds if the two values match. Uses Test::LongString's "is_string" function to do the test. xml_like_long $xml, $xpath, $regex, 'test description' Find the XML corresponding to the the XPath expression and check it against the supplied regular expression. Succeeds if they match. Uses Test::More's "like" function to do the comparison. xml_like $xml, $xpath, $regex, 'test description' Find the XML corresponding to the the XPath expression and check it against the supplied regular expression. Succeeds if they match. Uses Test::LongString's "like_string" function to do the test. xml_is_deeply_long $xml, $xpath, $xml2, 'test description' Find the piece of XML corresponding to the XPath expression, and compare its structure and contents to the second XML (fragment) supplied. Succeeds if they match in structure and content. Uses Test::More's "is" function to do the comparison. xml_is_deeply $xml, $xpath, $xml2, 'test description' Find the piece of XML corresponding to the XPath expression, and compare its structure and contents to the second XML (fragment) supplied. Succeeds if they match in structure and content. Uses Test::LongString's "is_string" function to do the test. AUTHOR
Joe McMahon, <mcmahon@cpan.org> LICENSE
Copyright (c) 2005 by Yahoo! and Joe McMahon This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.6.1 or, at your option, any later version of Perl 5 you may have available. SEE ALSO
XML::XPath, Test::More, Test::Builder. perl v5.14.2 2012-06-05 Test::XML::Simple(3pm)
All times are GMT -4. The time now is 09:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy