export
Writes the dataset in memory out as a spreadsheet or a text file.
What we have
export delimitedfor comma-separated textexport excelfor.xlsx
Coming later
putexcel, writing into a particular cell- exporting a formatted table rather than the data itself
How you write it
export delimited using "file.csv" [, replace] | export excel using "file.xlsx" [, replace]
Square brackets mean optional. A vertical bar means choose one.
What it does
The counterpart to import, for handing results to someone who does not use Virata. export delimited writes comma-separated text, which anything can open; export excel writes an .xlsx workbook.
Use save instead when the file is for you: it keeps the labels, and text formats do not.
Try it
Every example below was run after sysuse vira.sample02, clear.
. export delimited using "out.csv", replace
file out.csv saved
The same thing in pandas and in R
R
# no R form for `export` yet -- see docs/r-equivalents.md