how to delete two adjecent lines in a text file
hello, experts,
I need to delete the lines containing letter "a" and the next line together from a tect file. I found the two lines with fgrep a -A 1 filename But I do not know how to delete them. Please help me, Thank you in advance, |
Code:
awk '/a/{getline;next}1' file |
Quote:
For example, if file is the following: Code:
a Code:
$ awk '/a/{getline;next}1' file Code:
d |
sed -e '/a/,2D' <filename>
will delete all lines with 'a' in them, but the first instance will also delete the following line. |
All times are GMT -5. The time now is 08:09 AM. |