sed - extract text from xml file | Unix Linux Forums | Shell Programming and Scripting

  Go Back    

Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

sed - extract text from xml file

Shell Programming and Scripting

Closed Thread    
Thread Tools Search this Thread Display Modes
Old 02-09-2012
gioni gioni is offline
Registered User
Join Date: Feb 2012
Last Activity: 12 September 2012, 1:31 PM EDT
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
sed - extract text from xml file


please help, i have an xml file, e.g:

<tag> test text


i want to extract all "${...}", e.g:

thank you.
Sponsored Links
Old 02-09-2012
Scrutinizer's Avatar
Scrutinizer Scrutinizer is offline Forum Staff  
Join Date: Nov 2008
Last Activity: 27 January 2015, 11:21 PM EST
Location: Amsterdam
Posts: 9,807
Thanks: 311
Thanked 2,531 Times in 2,265 Posts
Does you grep have a -o option? ( man grep | grep '^[ \t]*\-o' ) then you can try this:

grep -o '${[^}]*}' infile

Sponsored Links
Old 02-10-2012
tarun_agrawal tarun_agrawal is offline
Registered User
Join Date: Jul 2011
Last Activity: 29 May 2012, 10:09 PM EDT
Posts: 87
Thanks: 0
Thanked 16 Times in 15 Posts
try this

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

Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
extract text from a file loperam Shell Programming and Scripting 2 06-18-2010 08:02 PM
extract blocks of text from a file cajunfries Shell Programming and Scripting 7 05-18-2009 12:41 PM
c program to extract text between two delimiters from some text file kukretiabhi13 Programming 7 12-03-2008 06:29 PM
How to extract text from xml file chrisf Shell Programming and Scripting 3 09-01-2007 03:25 PM
How to extract data from a text file negixx Shell Programming and Scripting 1 07-19-2005 10:30 PM

All times are GMT -4. The time now is 08:07 AM.