Find the answer to your Linux question:
Results 1 to 3 of 3
I need to update very old mail files to make them mbox compliant. What I need to do is find all lines beginning with ^To: and put a comma between ...
  1. #1
    Just Joined!
    Join Date
    Jun 2010
    Posts
    2

    Sed script help

    I need to update very old mail files to make them mbox compliant. What I need to do is find all lines beginning with ^To: and put a comma between a random number of names on this To: line. So I want to replace the 2nd and all subsequent <space> on this lines with ,<space>.

    It should be something like:

    s/^To: [ ]/&,/2g

    But that isn't correct. Any help?

    Thanks
    J. Craig

  2. #2
    tpl
    tpl is offline
    Linux User
    Join Date
    Jan 2007
    Location
    cleveland
    Posts
    452
    welcome to the forum

    can you supply an example, of the input...and what you want as output?
    the sun is new every day (heraclitus)

  3. #3
    Just Joined!
    Join Date
    Jun 2010
    Posts
    2

    Solved

    Brute force - I couldn't elegantly find a single sed command so I piped the output of one sed command to another.

    Thanks
    J. Craig

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...