help insheet dialog: insheet
-------------------------------------------------------------------------------
Title
[D] insheet -- Read ASCII (text) data created by a spreadsheet
Syntax
insheet [varlist] using filename [, options]
options description
-------------------------------------------------------------------------
[no]double override default storage type
tab tab-delimited data
comma comma-delimited data
delimiter("char") use char as delimiter
clear replace data in memory
case preserve variable name's case
+ [no]names variable names are included on the first line of
the file
-------------------------------------------------------------------------
+ [no]names is not shown in the dialog box
Menu
File > Import > ASCII data created by a spreadsheet
Description
insheet reads into memory from a disk a dataset that is not in Stata
format. insheet is intended for reading files created by a spreadsheet
or database program. Regardless of the creator of the file, insheet
reads text (ASCII) files in which there is 1 observation per line and the
values are separated by tabs or commas. Also the first line of the file
can contain the variable names. If you type
. insheet using filename
insheet reads your data; that is all there is to it.
If filename is specified without an extension, .raw is assumed. If your
filename contains embedded spaces, remember to enclose it in double
quotes.
Stata has other commands for reading data. If you are not sure that
insheet will do what you are looking for, see [D] infile and [U] 21
Inputting data. If you want to save your data in spreadsheet-style
format, see [D] outsheet.
Options
[no]double affects the way Stata handles the storage of floating-point
variables. If the default storage type (see [D] generate) is set to
float, specifying the double option forces Stata to store
floating-point variables as doubles rather than floats. If the
default storage type has been set to double, you must specify
nodouble to have floating-point variables stored as floats rather
than doubles; see [D] data types.
tab tells Stata that the values are tab-separated. Specifying this
option will speed insheet's processing, assuming that you are right.
insheet can determine for itself whether the separation character is
a tab or a comma.
comma tells Stata that the values are comma-separated. Specifying this
option will speed insheet's processing, assuming that you are right.
insheet can determine for itself whether the separation character is
a comma or a tab.
delimiter("char") allows you to specify other separation characters. For
instance, if values in the file are separated by a semicolon, specify
delimiter(";").
clear specifies that it is okay for the new data to replace the data that
are currently in memory. To ensure that you do not lose something
important, insheet will refuse to read new data if data are already
in memory. clear allows insheet to replace the data in memory. You
can also drop the data yourself by typing drop _all before reading
new data.
case preserves the variable name's case. By default, all variable names
are imported as lowercase.
The following option is available with insheet but is not shown in the
dialog box:
[no]names informs Stata whether variable names are included on the first
line of the file. Specifying this option will speed insheet's
processing, assuming that you are right. insheet can determine for
itself whether the file includes variable names.
Examples
. insheet using auto.raw
. insheet using auto.raw, clear
. insheet using auto.raw, clear double
Also see
Manual: [D] insheet
Help: [D] infile (free format), [D] outfile, [D] outsheet, [D] rename,
> [D] save