title: unix - remove (i) empty space between single characters and (ii) more than X consecutive instances of a word
body: <p>I would like to </p>
  
  <p>(i) replace blank space between characters only if these characters are <em>single</em>; i.e. for instance</p>
  
  <pre><code>Down [Enter] p s -- a u x [Delete] 
  </code></pre>
  
  <p>should become</p>
  
  <pre><code>Down [Enter] ps -- aux [Delete] 
  </code></pre>
  
  <p>(ii) remove words that are consecutively repeated more than X times until any other thing which is not the word, so that (say X=2)</p>
  
  <pre><code> [Delete] [Delete] [Delete] [Delete] [Delete] [Delete] ab inition [Delete] [Delete] [Delete] [Delete] [Delete] [Delete] ab definitio
  </code></pre>
  
  <p>becomes</p>
  
  <pre><code> [Delete] [Delete] ab initio [Delete] [Delete] ab definitio
  </code></pre>
  
  <p>thanks!</p>