Hello,
I've downloaded some course codes from the internet that look like "09.0111", "90.0100" and "90.1000". Now, I need the leading zeros, as well as those after the decimal point to remain, but when I import them to Stata (from an Excel file), the zeros are omitted, even if the course code variable is imported as a string. They look like: "9.0111", "90.01" and "90.1".
How do I add the zeros back to the strings? Obviously, only certain observations need to have the added zeros, not all. All the codes need to be 6 digits long.
Thank you,
Amrita Sanyal.
I've downloaded some course codes from the internet that look like "09.0111", "90.0100" and "90.1000". Now, I need the leading zeros, as well as those after the decimal point to remain, but when I import them to Stata (from an Excel file), the zeros are omitted, even if the course code variable is imported as a string. They look like: "9.0111", "90.01" and "90.1".
How do I add the zeros back to the strings? Obviously, only certain observations need to have the added zeros, not all. All the codes need to be 6 digits long.
Thank you,
Amrita Sanyal.
Comment