How to replace empty cells and Infinity cells with zero in the entire dataset at once? Well thank you.
-
Login or Register
- Log in with
replace yourvar=0 if yourvar==.
. replace yourvar="0" if yourvar=="Infinity" | yourvar=="."
. destring yourvar, g(num_yourvar)
yourvar: all characters numeric; num_yourvar generated as byte
. list
+--------------------+
| yourvar num_yo~r |
|--------------------|
1. | 0 0 |
2. | 0 0 |
+--------------------+
.
Comment