title: Replace newlines for lines matching regular expression
body: <p>I have a file like:</p>
  
  <pre><code>72810 82:28:1
  this is text
  hello world
  
  72810 82:28:12
  some more text
  hello wolrd again
  </code></pre>
  
  <p>I need to replace the newline characters in just the lines containing 72810*
  But there's a catch: I have tried the following:</p>
  
  <p><code>sed 's/\n/ /g' myfile.txt</code></p>
  
  <p>But this doesn't work.</p>
  
  <p>I have also tried:</p>
  
  <p><code>cat myfile.txt | perl -p -e 's/72810.*\n/72810 /g'</code></p>
  
  <p>But this doesn't save the full original text (72810 82:28:1  or 72810 82:28:12 in this case). </p>
  
  <p>What do I need to do to end up with the file looking like:</p>
  
  <pre><code>72810 82:28:1 this is text
  hello world
  
  72810 82:28:12 some more text
  hello world again
  </code></pre>
  
  <p>By the way, I'm using solaris.</p>