title: How to export tabulations
body: <p>I have a small project where I need to tabulate a dataset with frequencies in various ways and export those tables in a large Excel sheet. Unfortunately, copy and paste truncates text-labels and causes lots of other issues for us.</p>
  
  <p>Is there a way to save/export the result into a <a href="http://en.wikipedia.org/wiki/Comma-separated_values" rel="nofollow noreferrer">CSV</a> or Excel format?</p>
  
  <p>That is, something similar to the <code>write.table</code> command in <a href="http://en.wikipedia.org/wiki/R_%28programming_language%29" rel="nofollow noreferrer">R</a>, which I can't install at work.</p>
  
  <hr>
  
  <p><strong>Update 1:</strong></p>
  
  <p>The Stata FAQ provided three solutions which would work for us: <a href="http://www.stata.com/support/faqs/data-management/copying-tables/" rel="nofollow noreferrer">http://www.stata.com/support/faqs/data-management/copying-tables/</a>, but Stata support did a followup mail a shortly after pointing to the FAQ with a link to tabout and the tutorial displayed some truly beautiful tabulations. </p>
  
  <p><img src="https://i.stack.imgur.com/qJw9b.png" alt="Table from the tutorial"></p>
  
  <p>We've had some progress with the tabout, but we are not really sure if it would do everything we need, but so far creating tabulations with tabout D7 test.xls works nicely although without any proper aligment of labels and such as you would get generating <a href="http://en.wikipedia.org/wiki/LaTeX" rel="nofollow noreferrer">LaTeX</a>.</p>
  
  <hr>
  
  <p><strong>Update 2:</strong></p>
  
  <p>OK, so lots of tables weren't as straightforward as with tabulate and the by command in combination - some programming was required (not done at current Stata skill-level). The lack of native support for just exporting any result out is a real pain!</p>