- clear
- input ///
- str19 x
- 1234567890123456789
- 123456789012345678
- 12345678901234567
- 1234567890123456
- 123456789012345
- end
- destring x,gen(x1)
- format x1 %20.0f
- rencode x,gen(x2)
- label drop _all
- list
复制代码
destring是不能行的,在format是不行的,看看结果就知道了
rencode是从新编码,但当编码格式超过16为的时候仍然也是不行的,这是软件本身就决定了的
. clear
.
. input ///
> str19 x
x
1. 1234567890123456789
2. 123456789012345678
3. 12345678901234567
4. 1234567890123456
5. 123456789012345
6. end
.
. destring x,gen(x1)
x has all characters numeric; x1 generated as double
. format x1 %20.0f
.
. rencode x,gen(x2)
. label drop _all
.
. list
+------------------------------------------------+
| x x1 x2 |
|------------------------------------------------|
1. | 1234567890123456789 1234567890123456800 5 |
2. | 123456789012345678 123456789012345680 4 |
3. | 12345678901234567 12345678901234566 3 |
4. | 1234567890123456 1234567890123456 2 |
5. | 123456789012345 123456789012345 1 |
+------------------------------------------------+