Announcement

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

  • Extrac the numbers in variable labels

    Hi,


    How can I extract the numeric part from my variable labels? For example:

    I have the next var label:

    "Income500"

    And I want:

    "Income"


    Thank You
    S.







  • #2
    Where do you want that? Do you want new variable labels? Do you want those in a local macro? Do you want anything else? Do you want to do this for more than one variable? A simple example using dataex could be useful here.

    In general, you store a variable's label in a local macro with

    Code:
    local label : variable label varname
    You can then use string functions (including regular expressions) to manipulate the local macro.

    Best
    Daniel

    Comment

    Working...
    X