The UNIX and Linux Forums
>
Top Forums
>
Shell Programming and Scripting
Include Line Before Pattern Using Sed / Awk
.
User Name
Remember Me?
Password
google unix.com
Forums
Register
Forum Rules
Links
Albums
FAQ
Members List
Calendar
Search
Today's Posts
Mark Forums Read
Thread
:
Include Line Before Pattern Using Sed / Awk
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
#
2
(
permalink
)
04-22-2009
devtakh
Registered User
Join Date: Oct 2007
Location: Bangalore
Posts: 514
try this
sed
-e 's/\(CREATE TYPE \([^ ]*\) .*$\)/DROP TYPE \2 FORCE\n\1/g' -e 's/\(CREATE OR REPLACE TYPE \([^ ]*\) .*$\)/DROP TYPE \2 FORCE \n\1/g' Test.sql
cheers,
Devaraj Takhellambam
devtakh
View Public Profile
Find all posts by devtakh
Find devtakh's past nominations received
Find devtakh's present nominations given