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

Re: Search and write

Expand Messages
  • Lars Iselid
    Checked carefully again and I had missed a point. Sorry! But in my result each string of digits (10 to 17) from same line (or paragraph) is sorted in one
    Message 1 of 11 , Sep 1, 2011
      Checked carefully again and I had missed a point. Sorry! But in my result each string of digits (10 to 17) from same line (or paragraph) is sorted in one string without spaces. How to get the output sorted in one column with each string of digits in each row? Or at least spaces between each string of digits?

      Lars




      On Thu, Sep 1, 2011 at 1:06 PM, Christian Brabandt <cblists@...> wrote:
      Hi Lars!

      On Do, 01 Sep 2011, Lars Iselid wrote:

      > Still gets the whole content to the my.txt file. How to not write the whole
      > buffer?

      Please show the exact command you used.

      regards,
      Christian
      --

      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php
    • Christian Brabandt
      Hi Lars! ... Can you please share an example, what your data looks like before and what it looks like afterwards and how it should differ. I find it hard to
      Message 2 of 11 , Sep 1, 2011
        Hi Lars!

        On Do, 01 Sep 2011, Lars Iselid wrote:

        > Checked carefully again and I had missed a point. Sorry! But in my result
        > each string of digits (10 to 17) from same line (or paragraph) is sorted in
        > one string without spaces. How to get the output sorted in one column with
        > each string of digits in each row? Or at least spaces between each string of
        > digits?

        Can you please share an example, what your data looks like before and
        what it looks like afterwards and how it should differ. I find it hard
        to understand what you want.

        regards,
        Christian

        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php
      • Tim Chase
        ... For this, I d tend to do something like put each match on its own line and then delete all lines that don t contain that pattern. Something like ... Note
        Message 3 of 11 , Sep 1, 2011
          On 09/01/11 01:10, Lars Iselid wrote:
          > I want to write the digits and actually my full regex in vim
          > is: /[-0-9]\{13,17\}
          >
          > I want numbers with 13 to 17 digits even if they have hyphens
          > between the digits.

          For this, I'd tend to do something like put each match on its own
          line and then delete all lines that don't contain that pattern.
          Something like

          :%s/[-0-9]\{13,17\}/\r&\r/g
          :v/[-0-9]\{13,17\}/d

          Note that this does modify your current buffer, so either (1)
          operate on a scratch buffer or (2) remember to undo it before
          saving if your original source data isn't easily reproducible.

          It gets a little trickier if you have multiple matches on the
          same line AND you want to keep them on the same line (the above
          puts each match in the same line onto its own line).

          -tim


          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php
        Your message has been successfully submitted and would be delivered to recipients shortly.