I want to rename the varlists in different files having different the numbers of varlists.
e.g
I want do the following commods in first file
ren A v1_1
ren B v2_1
ren C v3_1
ren D v4_1
ren E v5_1
ren F v6_1
ren G v7_1
ren H v8_1
ren I v9_1
ren J v1_2
ren K v2_2
ren L v3_2
ren M v4_2
ren N v5_2
ren O v6_2
ren P v7_2
Do the following commods the other file
ren A v1_1
ren B v2_1
ren C v3_1
ren D v4_1
ren E v5_1
ren F v6_1
ren G v7_1
and there are so many files,so I wonder is there some way to simpliy this process,such as set a dictionary if the name is A,rename it as v1_1,or count the number of the varlists,and execute the first few columns,but I don't know how to realize this idea.
Related Posts with How to execute some commands in .do according to conditions?
Questions in doing semHi there! I want to conduct an SEM model to test the mediator. However, it shows 'factor-variable op…
Adding Significance Stars to a Coefplot generated with MatricesDear Stata Forum, I am currently trying to add significance stars to a graph I generate via coefplot…
Merging more than two data sets using macros and foreach loopHello Everyone, I want to merge three datasets using macros and foreach loop. The file names are 1.…
Free 2-day seminar on Stata's sem and gsem commandsHi everyone, over the holidays Instats is offering some free 2-day seminars on Path Modeling includi…
Problems with command asdocHi there, I am trying to create a multiple regression table with the command 'asdoc' for a Tobit mo…
Subscribe to:
Post Comments (Atom)
0 Response to How to execute some commands in .do according to conditions?
Post a Comment