title: Convert a file into CSV with newline as the delimiter
body: <p>I've got a lot of data that is new line delimited, copied raw from a server.  However, I cannot convert it into a CSV by simply replacing all <code>\n</code> into a comma since I need to have the fields.  There are 9 fields in this occasion.  How can I convert this data?<br>
  Keeping in mind that the last element doesn't need a comma since that will need to retain the newline character.  </p>
  
  <p>I am horrible at regular expression foo, but since I have the loop being needed, I assume I will need to make this into a shell script?  </p>
  
  <p>Any help is greatly appreciated.  </p>
  
  <p>Example data:</p>
  
  <pre><code>Name
  Logon User
  IP Address
  Version
  Last Login
  Restart Required
  Foo1
  Foo2
  Foo3
  Jon Weinraub
  jweinraub
  10.18.66.10
  3.1.1.1
  2013-08-19 14:33:11
  No
  Bar1
  Bar2
  Bar3
  Homer Simpson
  ....
  </code></pre>
  
  <p>So essentially it should be</p>
  
  <pre><code>Name,Logon User, IP,...Foo3
  Jon Weinraub,jweinraub,10.18.66.10,...Bar3
  Homer Simpson,....
  </code></pre>