I have a file where every line starts with a number (followed by whitespace and a bunch of other stuff). Every number appears on either one or two lines, and if two, the second line always has a
b after the number.
I need to delete every line for which there's a corresponding
b line. But if there's no corresponding
b line I want to leave the original line there.
123 foo bar 456 blarg 789 quux 123b foo baz 789b quux blurble
123b foo baz 456 blarg 789b quux blurble
Except in my real file, I have a thousand lines and it'd take a year to do by hand. Vim to the rescue:
And that is why Vim is awesome. Can you think of a shorter way to do this, in Vim or Emacs?