![]() |
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 |
| URGENT: Script/Function needed to read text property files in block wise | ysreenivas | Shell Programming and Scripting | 7 | 05-11-2009 04:08 AM |
| need one liner to edit this text... | ilan | Shell Programming and Scripting | 3 | 04-24-2008 06:25 AM |
| Building Full-Text Search Applications with Oracle Text | iBot | Oracle Updates (RSS) | 0 | 04-06-2008 06:10 AM |
| Edit and insert character in a text file | negixx | Shell Programming and Scripting | 3 | 06-10-2005 02:36 PM |
| Urgent answer needed, please: help with a text editor | MtFR | UNIX for Dummies Questions & Answers | 4 | 05-22-2004 01:05 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Could someone please tell me how to delete all lines above a line which contains a particular string? (possibly using SED command)
I know how to do this if the target string appears in only one line of file but when it appears in multiple lines it only deletes from the first line which the string appears to the top line. I want it to delete from the last line which the string appears to the top line. e.g I have the file below which contains 8 lines: Code:
$ cat file.txt a b c d a b c d $ Code:
c d sed '1,/b/d' file.txt Regards, Steve |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|