Announcement

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

  • Loop

    I want to change the name of fields in a loop. For example, how can I delete the last two characters of the fields if they end by 20 ?
    I could do it without a loop :
    Code:
    rename (var20 var020 varz020) (var var0 varz0)
    but it will be error source in copy paste.

    Thank you !

  • #2
    Code:
    ren *20 *

    Comment


    • #3
      So easy !
      I didn’t know "*" could be used with Stata...

      Comment


      • #4
        Code:
        help varlist
        explains about wildcards in variable name lists, including *.

        Comment

        Working...
        X