Stata 15 help for type

[D] type -- Display contents of a file

Syntax

type ["]filename["] [, options]

Note: Double quotes must be used to enclose filename if the name contains blanks.

options Description ------------------------------------------------------------------------- asis show file as is; default is to display files with suffix .smcl or .sthlp as SMCL smcl display file as SMCL; default for files with suffix .smcl or .sthlp showtabs display tabs as <T> rather than being expanded starbang list lines in the file that begin with "*!" lines(#) list first # lines -------------------------------------------------------------------------

Description

type lists the contents of a file stored on disk. This command is similar to the Windows type command and the Unix more(1) or pg(1) commands.

In Stata for Mac and Stata for Unix, cat is a synonym for type.

On all platforms, Stata understands a leading "~" as an abbreviation for the home directory.

Options

asis specifies that the file be shown exactly as it is. The default is to display files with the suffix .smcl or .sthlp as SMCL, meaning that the SMCL directives are interpreted and properly rendered. Thus type can be used to look at files created by the log using command.

smcl specifies that the file be displayed as SMCL, meaning that the SMCL directives are interpreted and properly rendered. This is the default for files with the suffix .smcl or .sthlp.

showtabs requests that any tabs be displayed as <T> rather than being expanded.

starbang lists only the lines in the specified file that begin with the characters "*!" . Such comment lines are typically used to indicate the version number of ado-files, class files, etc. starbang may not be used with SMCL files.

lines(#) lists the first # lines of a file. lines() is ignored if the file is displayed as SMCL or if # is less than or equal to 0.

Examples

Windows: . type myfile.dct . type ..\dcts\myfile.dct

Mac and Unix: . type myfile.dct . type ../dcts/myfile.dct

--------------------------------------------------------------------------- Setup . log using mylog . sysuse auto . keep make price mpg rep78 foreign . keep in 1/10 . outfile using myout . outfile using myout, dictionary . log close

Display contents of myout.raw . type myout.raw

Display contents of myout.dct . type myout.dct

Display contents of mylog.smcl . type mylog.smcl

Display contents of mylog.smcl but show the file exactly as it is . type mylog.smcl, asis ---------------------------------------------------------------------------


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index