A diff command for use with data files
AbstractOne of the most important tools in a programmer's tool chest is the diff command. This command permits you to determine immediately if two code files are identical and, when they are not, to generate a patch which summarizes the differences and can be used to transform the first file into the second. In this presentation we shall introduce an analogous tool written for use with data files. Unlike code files in which each line is identified by its physical location within the file, records in a data file are typically identified by one or more indices, each composed of one or more distinct variables. Our tool compares two files based on one or more such indices, provides a compact, readable summary of the differences, and can generate a patch (in the form of a do-file) to update the first file based on the second. This tool is useful during data analysis whenever two or more versions of a data file are encountered, and may also be used by a Data Coordinating Center to manage repeated data submissions from multiple sites. The program was developed using Mata, and some of the programming techniques used will also be discussed.
Download InfoIf you experience problems downloading a file, check if you have the proper application to view it first. In case of further problems read the IDEAS help page. Note that these files are not on the IDEAS site. Please be patient as the files may be large.
Bibliographic InfoPaper provided by Stata Users Group in its series North American Stata Users' Group Meetings 2006 with number 12.
Date of creation: 23 Jul 2006
Date of revision:
This paper has been announced in the following NEP Reports:
- NEP-ALL-2006-08-05 (All new papers)
You can help add them by filling out this form.
reading list or among the top items on IDEAS.Access and download statisticsgeneral information about how to correct material in RePEc.
For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: (Christopher F Baum).
If references are entirely missing, you can add them using this form.