Add "if" condition #24
Description
My suggestion is to allow for an "if" condition in the command.
Many times, I am importing an excel where many values have not been reviewed yet. This means that I will have a column "Reviewed", used by the data entrant and that takes values 0/1 depending if the data entrant has already reviewed the value. Thus, I only want to readreplace if the entry has reviewed==1. Otherwise, it will replace a value by missing (because "newvalue" is missing by default).
So far I have been using the following workaround, but it would be nice to avoid doing this everytime.
What I do: Import the excel, keep only the value I want, save it as a tempfile, and then apply readreplace to the temfile.
preserve
import excel_filename, (...)
keep if review==1
tempfile excel_file
save `excel_file'
restore
readreplace using `excel_file', use (...)
I think it's a small thing but a very useful one! And please do let me know if there's already a way to do this in the same line as readreplace, maybe I've missed something.
Thank you!