.- Help for ^log2do^ Morten Andersen .- Converts Stata log files to Stata do files ------------------------------------------ ^logtodo^ logfilename[^, replace^] Description ----------- ^logtodo^ is made to convert ^log^ files to ^do^ files. It removes commands which led to errors, retains comments, and handles long lines which were wrapped by Stata. The file ^logfilename^ must be a the name of a ^log^ file (without its extension). The resulting ^do^ file has the same name, but an extension of .do. This command must be run on with an empty data set. Options ------- ^replace^ must be specified to overwrite and already existing ^do^ file. Examples -------- ^logtodo mylog^ will take the ^log^ file ^mylog.log^, and create the ^do^ file ^mylog.do^. If the file ^mylog.do^ already exists, ^logtodo^ will complain and exit. ^logtodo mylog, replace^ will take the ^log^ file ^mylog.log^, and create the ^do^ file ^mylog.do^. If the file ^mylog.do^ already exists, ^logtodo^ will overwrite it. Notes ----- While ^logtodo^ can handle most situations well, clever Stata programmers will be able to create situations where it fails by creating lines in the log file which mimic lines which Stata produces. Commands like ^disp ". nonsense"^ or ^disp "r(666);"^ or ^disp "> hee hee"^ will all cause logtodo to stumble. What twisted mind would be entering such commands while creating a log file? Author ------ Bill Rising Department of Biostatistics Johns Hopkins University brising@@jhsph.edu (410) 955-2468