![]() |
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 |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Delete line in text file | Berserk | UNIX for Dummies Questions & Answers | 6 | 12-16-2008 03:44 PM |
| how to delete text from line starting pattern1 up to line before pattern2? | repudi8or | Shell Programming and Scripting | 5 | 04-15-2008 09:25 PM |
| Delete first line from any text file ? | aungomarin | Shell Programming and Scripting | 5 | 05-16-2006 09:42 PM |
| delete a line based on first character of the line | borncrazy | UNIX for Dummies Questions & Answers | 2 | 12-06-2005 03:27 PM |
| delete last line from text file | hcclnoodles | Shell Programming and Scripting | 4 | 06-25-2002 09:52 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
how to delete line with matching text and line immediately after
hello experts,
I have a file: File1 Sample Test1 This is a Test Sample Test2 Another Test Final Test3 A final Test I can use sed to delete the line with specific text ie: sed '/Test2/d' File1.txt > File2.txt How can I delete the line with the matching text and the line immediately after. so My resulting file would look like File2: Sample Test1 This is a Test Final Test3 A final Test thanks |
|
||||
|
I used the awk suggestion below since I was already using awk for something else...It worked great
![]() thanks |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Tags |
| sed delete line |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|