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

Re: replace

Expand Messages
  • Kyle Lippincott
    This only does all of the files in one directory, is that what you intended? ... should work. http://en.wikipedia.org/wiki/Sed is the wikipedia page for sed,
    Message 1 of 8 , Aug 31, 2011
    • 0 Attachment
      This only does all of the files in one directory, is that what you intended?  If so:
      :!sed -i 's/sistema./replacement/' ~/workspace/canto/*
      should work.  http://en.wikipedia.org/wiki/Sed is the wikipedia page for sed, and there are many many tutorials out there on how to use it :)

      On Wed, Aug 31, 2011 at 1:39 PM, Cliff Oliveira <oliveira.cliff@...> wrote:
      I managed to locate the files using:! grep but how to replace the word being searched?

      I used

      :!grep sistema. ~/workspace/canto/*




      2011/8/31 David Patrick Henderson <dp.chaoswerks@...>

      On 31 Aug 2011, at 07:04, Cliff Oliveira wrote:

      I would like to find and replace at once a word within multiple directories from a project, MacVim offers this possibility?

      See help for vimgrep, args, and argsdo 


      David P Henderson
      --
      "Beautiful bodies and beautiful personalities rarely go together."
          -- Carl Jung

      --
      You received this message from the "vim_mac" 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



      --
       Cliff Oliveira
      www.tribodeideias.com.br

      --
      You received this message from the "vim_mac" 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_mac" 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
    • Cliff Oliveira
      ... [No write since last change] sed: 1: /Users/cliffoliveira/wo ... : command c expects followed by text I tried to put at the end but did not work
      Message 2 of 8 , Sep 1, 2011
      • 0 Attachment
        I tried the tip but sent it returned following error:

        :!sed -i 's/sistema./www./' ~/workspace/canto/*
        [No write since last change]
        sed: 1: "/Users/cliffoliveira/wo ...": command c expects \ followed by text

        I tried to put \ at the end but did not work



        2011/8/31 Kyle Lippincott <spectral@...>
        This only does all of the files in one directory, is that what you intended?  If so:
        :!sed -i 's/sistema./replacement/' ~/workspace/canto/*
        should work.  http://en.wikipedia.org/wiki/Sed is the wikipedia page for sed, and there are many many tutorials out there on how to use it :)

        On Wed, Aug 31, 2011 at 1:39 PM, Cliff Oliveira <oliveira.cliff@...> wrote:
        I managed to locate the files using:! grep but how to replace the word being searched?

        I used

        :!grep sistema. ~/workspace/canto/*




        2011/8/31 David Patrick Henderson <dp.chaoswerks@...>

        On 31 Aug 2011, at 07:04, Cliff Oliveira wrote:

        I would like to find and replace at once a word within multiple directories from a project, MacVim offers this possibility?

        See help for vimgrep, args, and argsdo 


        David P Henderson
        --
        "Beautiful bodies and beautiful personalities rarely go together."
            -- Carl Jung

        --
        You received this message from the "vim_mac" 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



        --
         Cliff Oliveira
        www.tribodeideias.com.br

        --
        You received this message from the "vim_mac" 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_mac" 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



        --
         Cliff Oliveira
        www.tribodeideias.com.br

        --
        You received this message from the "vim_mac" 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
      • Kyle Lippincott
        Doh. I forgot that -i takes an argument. Does sed -i -e s/sistema./www./ ~cliffoliveira/workspace/canto/* work? I keep responding from my iPhone, so I can t
        Message 3 of 8 , Sep 1, 2011
        • 0 Attachment
          Doh. I forgot that -i takes an argument.  Does sed -i -e 's/sistema./www./' ~cliffoliveira/workspace/canto/* work?

          I keep responding from my iPhone, so I can't really check if the command I'm giving has the correct syntax. :(

          On Sep 1, 2011, at 3:23, Cliff Oliveira <oliveira.cliff@...> wrote:

          I tried the tip but sent it returned following error:

          :!sed -i 's/sistema./www./' ~/workspace/canto/*
          [No write since last change]
          sed: 1: "/Users/cliffoliveira/wo ...": command c expects \ followed by text

          I tried to put \ at the end but did not work



          2011/8/31 Kyle Lippincott <spectral@...>
          This only does all of the files in one directory, is that what you intended?  If so:
          :!sed -i 's/sistema./replacement/' ~/workspace/canto/*
          should work.  http://en.wikipedia.org/wiki/Sed is the wikipedia page for sed, and there are many many tutorials out there on how to use it :)

          On Wed, Aug 31, 2011 at 1:39 PM, Cliff Oliveira <oliveira.cliff@...> wrote:
          I managed to locate the files using:! grep but how to replace the word being searched?

          I used

          :!grep sistema. ~/workspace/canto/*




          2011/8/31 David Patrick Henderson <dp.chaoswerks@...>

          On 31 Aug 2011, at 07:04, Cliff Oliveira wrote:

          I would like to find and replace at once a word within multiple directories from a project, MacVim offers this possibility?

          See help for vimgrep, args, and argsdo 


          David P Henderson
          --
          "Beautiful bodies and beautiful personalities rarely go together."
              -- Carl Jung

          --
          You received this message from the "vim_mac" 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



          --
           Cliff Oliveira
          www.tribodeideias.com.br

          --
          You received this message from the "vim_mac" 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_mac" 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



          --
           Cliff Oliveira
          www.tribodeideias.com.br

          --
          You received this message from the "vim_mac" 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_mac" 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.