log2do2

This program extracts the command lines from a Stata text-format log, creating a file of syntax (i.e., a do file). The program recognizes commands as lines in the log that begin with a period followed by a blank space. It also recognizes commands that are wrapped over multiple lines by Stata, and command that appear within foreach and forvalues loops. log2do2 uses the Stata 7 file command to read and write the file. The program is designed to preserve references to local macros in command lines.