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

Re: Modifying many lines in many files

Expand Messages
  • Christian Brabandt
    Hi Jeri! ... This sound like you want sed. For your use case, you probably want something like: sed -i s/ (.* ) $/ 1/ files ... Oh. On Windows, quoting
    Message 1 of 4 , Dec 25, 2010
    • 0 Attachment
      Hi Jeri!

      On Fr, 24 Dez 2010, Jeri Raye wrote:

      > I need to modify a many files, all in the same way.
      > The modification is to
      > - add one space-character at the beginning of every line.
      > - delete the space-character at the end of every line.
      >
      > In other words:
      > If the line looks like this:
      > [start of line]12345 [end of line]
      >
      > It needs to become:
      > [start of line] 12345[end of line]
      >
      > How to do that?

      This sound like you want sed. For your use case, you probably want
      something like:
      sed -i 's/\(.*\) $/ \1/' files

      > And I want to place this in a batch file (working on windows xp)?

      Oh. On Windows, quoting might be the problem. I don't know much about
      it. But with cygwin, it's straight forward.

      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
    Your message has been successfully submitted and would be delivered to recipients shortly.