The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 04-14-2008
robsonde robsonde is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 162
Quote:
Originally Posted by kholostoi View Post
This is my solution:

---------file : awk_tets --------------
BEGIN { flag = 0}
/^<bag name="mybag2"/ { flag = 1}
/^<bag name="mybag3"/ { flag = 0}
{ if (flag == 0) { print; } }
---------------------------------------

in command line: $ awk -f awk_test your_data_file > result

Let's try it
this is what i had in mind too, problem is that it may not handel nested ceses too well.....