title: Using sed to remove leading and trailing white spaces
body: <p>I have a file that looks like this:</p>
  
  <pre><code>   2 1 word
    78 3 other words
     2 some other words here
    54 bla bla
  </code></pre>
  
  <p>I'd like to remove whitespaces and put a comma between values and rest. the output should look like </p>
  
  <pre><code>2,1 word
  78,3 other words
  2,some other words here
  54,bla bla
  </code></pre>
  
  <p>The command </p>
  
  <pre><code>sed -e 's/\s*([0-9])+\s.+/&amp;/'
  </code></pre>
  
  <p>does not change anything</p>