Object Reference : Object View and Procedure Reference : Table
Save table to disk as a CSV, tab-delimited ASCII text, RTF, HTML, Enhanced Metafile, LaTeX, or PDF file.
table_name.save(options) [path\]file_name
Follow the keyword with a name for the file. file_name may include the file type extension, or the file type may be specified using the “t=” option.
If an explicit path is not specified, the file will be stored in the default directory, as set in the File Locations global options.
t=file_type (default=“csv”)
Specifies the file type, where file_type may be one of: “csv” (CSV - comma-separated), “rtf” (Rich-text format), “txt” (tab-delimited text), “html” (HTML - Hypertext Markup Language), “emf” (Enhanced Metafile), “pdf” (PDF - Portable Document Format), or “tex” (LaTeX).
Files will be saved with the “.csv”, “.rtf”, “.txt”, “.htm”, “emf”, and “pdf” extensions, respectively.
Scale size, where arg is from 5 to 200, representing the percentage of the original table size (only valid for HTML or RTF files).
Range of table cells to be saved. See Table::setfillcolor for the cell_range syntax. If a range is not provided, the entire table will be saved.
Replace all cells that contain NA values with the specified string. “NA” is the default.
f / -f
[Use full precision values/ Do not use full precision] when saving values to the table (only applicable to numeric cells). By default, the values will be saved as they appear in the currently formatted table.
Force the dialog to appear from within a program.
PDF Options
Save in landscape mode (the default is to save in portrait mode).
size=arg (default=“letter”)
Page size: “letter”, “legal”, “a4”, and “custom”.
width=number (default=8.5)
Page width in inches if “size=custom”.
height=number (default=11)
Page height in inches if “size=custom”.
leftmargin=number (default=0.5)
Left margin width in inches.
rightmargin=number (default = 0.5)
Right margin width in inches.
topmargin=number (default=1)
Top margin width in inches.
bottommargin= number (default = 1)
Bottom margin width in inches.
LaTeX Options
texspec / -texspec
[Include / Do not include] the full LaTeX documentation specification in the LaTeX output. The default behavior is taken from the global default settings.
The command:
tab1.save mytable
saves TAB1 to a CSV file named “MYTABLE.CSV” in the default directory.
tab1.save(t=csv, n="NAN") mytable
saves TAB1 to a CSV (comma separated value) file named MYTABLE.CSV and writes all NA values as “NAN”.
tab1.save(r=B2:C10, t=html, s=50) mytable
saves from data from the second row, second column, to the tenth row, third column of TAB1 to a HTML file named MYTABLE.HTM at half of the original size.
tab1.save(f, n=".", r=B) mytable
saves the data in the second column in full precision to a CSV file named “MYTABLE.CSV”, and writes all NA values as “.”.
For additional discussion of table commands see “Working with Tables and Spreadsheets”.
See “Table and Text Objects” for a discussion of tables.