The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
GREP and Retrieve Line by Line maxmave Shell Programming and Scripting 2 06-03-2008 12:45 PM
grep a string from 2 text files karthikn7974 Shell Programming and Scripting 15 04-24-2008 04:15 AM
getting particular text after grep from lookup file napolayan UNIX for Dummies Questions & Answers 10 10-20-2006 11:52 AM
grep multiple text files in folder into 1 text file? coppertone UNIX for Dummies Questions & Answers 7 08-23-2002 03:50 PM
grep'ing for text within a bunch of files...? kitykity UNIX for Dummies Questions & Answers 1 09-19-2000 09:50 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 12-16-2006
frustrated1 frustrated1 is offline
Registered User
  
 

Join Date: Aug 2003
Location: Ireland
Posts: 278
retrieve text after grep

I am trying to search for a pattern in a file containing xml - When I match the search I want to retrieve all the text within the xml brackets..
Whats the best way to read in data between xml tags in a shell script?

ie..
xml returned which I have in a file now is something like below:
<total>
<mainacc>5500</mainacc>
<BalAccs>

<BalAcc>
<AccId>1</AccId>
<Value>0</Value>
</BalAcc>

<BalAcc>
<AccId>2</AccId>
<Value>0</Value>
</BalAcc>

</BalAccs>
</total>

I need to find the section for mainacc and store that but also in the Balaccs section I need to find the information for the value fields in Accid 1 and 2 but also know that the value belongs to accid1 and accid2 ...


Any help??
I have never parsed xml before and not sure where to start ..
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 10:47 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0