![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Reading multiple tags from .asx files | underlig | Shell Programming and Scripting | 0 | 11-25-2006 01:27 AM |
| Removing leading and trailing spaces of data between the tags in xml. | jhmr7 | UNIX for Dummies Questions & Answers | 2 | 05-18-2005 11:27 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
how to get data from xml files tags(from data tags)
i have a file like
<fruits> <apple>redcolor<\apple> <bana 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 |
|
|||||
|
This should help you with a perl script:
XML::Simple - Easy API to maintain XML (esp config files) - search.cpan.org |
|
||||
|
nawk -F">" '{print $2}' file | nawk -F"<" '{print $1}' | grep . | grep your-pattern
with this method you are not hardcoding the tagnames, instead we are getting the string between > and the following < hence the output of this command is sa865h@sipc306> nawk -F">" '{print $2}' file | nawk -F"<" '{print $1}' | grep . redcolor yellow color and it is "grep ." will simply remove the empy lines Hope it is useful!!!!!!!!!!!!! |
![]() |
| Bookmarks |
| Tags |
| extract data from xml |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|