![]() |
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. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| how to remove specific lines from a file (reprise) | gogol_bordello | Shell Programming and Scripting | 7 | 07-10-2008 01:04 PM |
| How to remove the specific lines from file using perl | dipakg | Shell Programming and Scripting | 4 | 06-11-2008 03:45 AM |
| remove specific lines from flat file using perl | meghana | Shell Programming and Scripting | 12 | 02-12-2008 09:50 PM |
| how to remove specific lines from a file | bluemoon1 | Shell Programming and Scripting | 17 | 10-07-2007 11:40 PM |
| remove specific lines from a file | hcclnoodles | Shell Programming and Scripting | 14 | 09-07-2006 01:31 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Sed or Awk to remove specific lines
I have searched the forum for this - forgive me if I missed a previous post.
I have the following file: blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah alter table "informix".esc_acct add constraint (foreign key (fi_id) references "informix".fi constraint "informix".fk_esc_acct_from_fi); EOF I want to use sed or awk to remove the 'alter table' statement which in this example is two lines, it can be three or even four lines. I know how to remove one line with sed but I do not know how to tell sed "remove the line with the words 'foreign key' and continue removing lines up to and including the first ';' that you run into". These lines do not always appear at the end of the file. I am using KSH on a Solaris 10 box. Thanks for any help, Mike |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|