Tableizer is an AppleScript for TextWrangler (and BBEdit) that can convert plain text to tables. It works by taking data in which columns are delimited by tabs and rows are delimited by carriage returns into LaTeX tabular style (with columns delimited by ampersands and rows delimited by “\\”) [*]. For example, some data in the following format:
a b
c d
where there is a tab between consecutive characters on each row, can be highlighted and processed with Tableizer to produce
a & b \\
c & d \\
which is the LaTeX tabular format.
Suggested uses
Conversion from spreadsheets. When you copy a range of cells from within spreadsheet applications such as Excel or Calc and paste them into any plain text environment, the data are pasted as several rows of data with tabs between columns. Tables pasted in this format is ready for conversion to the LaTeX tabular style using Tableizer.
Conversion from Stata. Tables produced by Stata can be copied as tab/carriage-return delimited data by highlighting the entire table, right clicking, and selecting Copy as table (from within the Stata console, not log files). Data in this format are also ready to be converted to LaTeX tabular via Tableizer.
[*] Obviously if your tabular data contains tabs, the script will not work correctly.
Update — Tableizer v2
I have updated the Tableizer script to automatically prepare sensitive characters in LaTeX, such as “%,”, “|,” and “>,” which are frequently found in statistical output (for example, regression output from Stata, R or
SAS). The newer version is available here. You still need to watch out for other special characters, and if you prefer to leave the output unchanged, the original version will remain available (link above).