Loading ...
Sorry, an error occurred while loading the content.

Re: replacement question

Expand Messages
  • A. J. Mechelynck
    ... Assuming you want to delete the length and width of the room (where length is a word) but not the line will be lengthened (where it isn t), you could use
    Message 1 of 6 , Jan 1, 2006
    • 0 Attachment
      Alessandro wrote:
      > Hello,
      >
      > I'm trying to remove lines in a file that have the word "length".
      >
      > I did so like this:
      >
      > :%s/.*length.*//g
      >
      > But this, as you probably know, leaves a blank line in place of the line
      > that was there before. I wold like to make it so that the lines is
      > completely erased, as in all lines after that should go up one (like
      > doing "dd" on each line that contains "length").
      >
      > Thank you,
      >
      > ~Ale
      >
      >
      >
      >

      Assuming you want to delete

      the length and width of the room

      (where "length" is a word) but not

      the line will be lengthened

      (where it isn't), you could use

      :g/\<length\>/d

      see
      :help :g
      :help :d
      :help pattern

      HTH,
      Tony
    • Ted Arnold
      ... I find it amusing that you weenies are so stupid. Here, Alessandro, cannot figure out a simple task. What an idiot. Sheesh. I see this idiocy is typical
      Message 2 of 6 , Jan 1, 2006
      • 0 Attachment
        Alessandro wrote:
        > Hello,
        >
        > I'm trying to remove lines in a file that have the word "length".
        >
        > I did so like this:
        >
        > :%s/.*length.*//g
        >
        > But this, as you probably know, leaves a blank line in place of the line
        > that was there before. I wold like to make it so that the lines is
        > completely erased, as in all lines after that should go up one (like
        > doing "dd" on each line that contains "length").
        >
        > Thank you,
        >
        > ~Ale
        >
        >

        I find it amusing that you weenies are so stupid.

        Here, Alessandro, cannot figure out a simple task. What an idiot. Sheesh.

        I see this idiocy is typical among those asking questions.

        What helpless idiots you vim people are. Stupid-wise, you're at the bottom.
      Your message has been successfully submitted and would be delivered to recipients shortly.