Hello everyone,

I have a rather simple question and was wondering if someone can help me with it.

This problem does not require a dataset as it is related to selecting variables for destring.

I have 6 variables that have similar starting words for example:
  1. a_b_c_1
  2. a_b_c_d_1
  3. a_b_c_2
  4. a_b_c_d_2
  5. a_b_c_3
  6. a_b_c_d_3
Now I want to destring variable numbers 1,3 and 5. I want to sort of automate this process by using a wildcard however when i say a_b_c_* it picks up 2,4 and 6 as well.

How can i make this happen?

One more point I would like to add is that over time the numeric suffix will increase to 4,5,6,... and so on that ideally should be addressed.