Hi,
I have two data sets, that I want to append. They contain the same variables and information. However, the variables are named differently in both data sets. In data set A variables are named: v31002, v31003, v31004..... In data set B variables are named: v31202, v31203, v31204....
I now want to rename the variables from data set B, so that they are the same as in data set A. Hence, I want to replace the 2 (or: the 4th digit of each variable name) with a 0. So my question only refers to the name of the variable, not the content.
Is there a possiblity to do this with a loop? So that I don“t have to rename every variable individually?
Many thanks and best,
Wiebke
I have two data sets, that I want to append. They contain the same variables and information. However, the variables are named differently in both data sets. In data set A variables are named: v31002, v31003, v31004..... In data set B variables are named: v31202, v31203, v31204....
I now want to rename the variables from data set B, so that they are the same as in data set A. Hence, I want to replace the 2 (or: the 4th digit of each variable name) with a 0. So my question only refers to the name of the variable, not the content.
Is there a possiblity to do this with a loop? So that I don“t have to rename every variable individually?
Many thanks and best,
Wiebke
Comment