worldbank/iefieldkit

iecorrect: mark which changes have been implemented

Closed this issue · 0 comments

From the Stata Journal review:

One thing that I messed up and took me awhile to figure out, is that I put the wrong current value in for one of the numeric variables. I didn’t get an error or warning or anything, it just didn’t change that observation. It would be nice to either get a warning or mark in the spreadsheet which changes were implemented.

To do this, we would need to

  • Check that the input file is closed
  • Have the input file open as a separate dataset/tempfile
  • Count the number of observations where changes were made
  • Add that to the tempfile
  • Add a time stamp indicating the last time this change was implemented to the tempfile
  • Merge the tempfile to the original input file
  • Replace the input file with the updated version
  • If any line makes no changes to the data, print a message that reads: "At least one of the lines in the spreadsheet did not create any modifications in the data. Refer to column [Obs modified] in the spreadsheet for details on which lines caused this error."