. clear
. input c1 c2 c3 c4
c1 c2 c3 c4
1. 1 2 3 4
2. 5 6 7 8
3. end
. dataex
----------------------- copy starting from the next line -----------------------
- * Example generated by -dataex-. To install: ssc install dataex
- clear
- input double(c1 c2 c3 c4)
- 1 2 3 4
- 5 6 7 8
- end
------------------ copy up to and including the previous line ------------------
如何将
3 4
7 8
整体向下移动两行,变成
. clear
. input c1 c2 c3 c4
c1 c2 c3 c4
1. 1 2 0 0
2. 5 6 0 0
3. 0 0 3 4
4. 0 0 7 8
5. end
. dataex
----------------------- copy starting from the next line -----------------------
- * Example generated by -dataex-. To install: ssc install dataex
- clear
- input double(c1 c2 c3 c4)
- 1 2 0 0
- 5 6 0 0
- 0 0 3 4
- 0 0 7 8
- end
------------------ copy up to and including the previous line ------------------
Listed 4 out of 4 observations
当然,这里是变量数量少。如果数量很多的时候,比如 varlist c1-c200,怎么将c3-c4下移两行,c5-c6下移四行,c7-c8下移六行(以此类推)?
急求!谢谢大神指点迷津。