Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to replace a word in do file by another word?

    In do file, I know we can use Ctr+F to find a word, but I am not sure how come we can find and replace a word by shortcut rather than double click and replacing manually.

    For example, I have the code

    Code:
    reghdfe y pt idvpt $fatcovariates, a(TYPE2 yr)
    est sto m5
    *idvpt based on spec 4;
    
    reghdfe y pt idvpt $fatcovariates, a(TYPE2 INDC32#yr)
    est sto m6
    
    *maspt based on spec 2;
    reghdfe y pt maspt $fatcovariates, a(TYPE2 yr)
    I want to replace all fatcovariates by abz

  • #2
    With the Do-file Editor window open, from Stata's Edit menu select Find > Find and Replace. The menu should also show the keyboard shortcut, but since I use Stata for Mac I do not know what that will be on Windows.
    Last edited by William Lisowski; 24 Jul 2021, 17:02.

    Comment


    • #3
      In Windows, it's Ctr+H.

      Comment

      Working...
      X