title: sed: replace multiple periods with another character
body: <p>I'm making a table in emacs org-mode of sunrise-commander commands from the .el file (want to make a cheat sheet). The list looks like this:</p>
  
  <pre><code>/, j .......... go to directory
  p, n .......... move cursor up/down
  M-p, M-n ...... move cursor up/down in passive pane
  ^, J .......... go to parent directory
  ...
  </code></pre>
  
  <p>I want to make that into an org-mode table with this format:</p>
  
  <pre><code>| /, j     | go to directory                     |
  | p, n     | move cursor up/down                 |
  | M-p, M-n | move cursor up/down in passive pane |
  | ^, J     | go to parent directory              |
  ...
  </code></pre>
  
  <p>Org will take care of spacing; I just need "| command | explanation |"</p>
  
  <p>I can't get sed to replace multiple periods with a vertical slash. My current attempts have been like this:</p>
  
  <pre><code>cat in.org | sed -e 's/[.]*/|/g' &gt; out.org
  cat in.org | sed -e 's/[.]/|/g' &gt; out.org
  cat in.org | sed -e 's/[.*]/|/g' &gt; out.org
  </code></pre>
  
  <p>I've already used this to replace leading and trailing whitespace with vertical slashes:</p>
  
  <pre><code>sed -e 's/^[ \t]*/|/g;s/[ \t]*$/|/g'|
  </code></pre>
  
  <p>Now I just need to do the same for a string of periods. I'm afraid I don't understand sed well enough to get it to treat periods like a period (and target a blob of them) rather than treating them as wildcards. The second and third treat each period like a period, as I end up with a bunch of vertical slashes.</p>
  
  <p>But the first just seem to put a vert slash between every single character so I'm not sure why it's doing that. It seems like it's going back to acting like the wildcard character.</p>
  
  <p>Thanks for any help.</p>