![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Sed Question
I'm new at shell scripting and wanna ask how can i use sed command for deleting data between two xml tag such as
Now: </outbox>asd<outbox> After sed command : </outbox><outbox> Ps: i used => sed -e 's/<\/outbox>[a-z]*<outbox>//g' filein > fileout |
|
||||
|
Hi,
one way is: Code:
sed "s/\(<[^>]*>\)[^<]*\(<[^>]*>\)/\1\2/" file HTH Chris |
|
||||
|
Quote:
Example updated : <book> <thriller>abc</thriller> <comedy>vfg</comedy> </book> I want to delete everything between <book> and </book> ; " .* " doesnt work for new lines ; its only usefull for one lined xml tags.How can i bypass the new line (enter). Ps:the updated example is the real format of my XML |
![]() |
| Bookmarks |
| Tags |
| shell script, shell scripting, unix scripting, unix scripting basics |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|