Hi,
I have a dataset where the variable id is stored as a str9, although this id has only 8 characters of lenght in some registers. I have something like this (below). The id "00831782" has a lenght of 9 although it has only 8 characters and also it has been stored as a str9. I can see that there is a blank at the end of this registers so it counts them with a lenght of 9 (the are like stucked to the left in the browser). How I can remove this blank space at the final of this registers to identify the real lenght?
Im trying to merge this registers with another database but i cant because this registers have been stored as str9 and have only 8 characters while in the other database the are stored as str8.
id / length
000532048 / 9
000371958 / 9
001246584 / 9
00831782 / 9
01322658 / 9
01323954 / 9
I would really appreciate if you could help me.
Related Posts with Change the lenght of a string
Multinomial logistic regression with Panel DataSuppose you have panel data (many observations for each person) and you have a discrete ordered outc…
Efficient way to calculate maximum number of observations before and after a specific value in a columnHi, I am using STATA version 16 and would need some help in counting the maximum number of observat…
treated group with if conditionHello everyone, I am relatively new to Stata and I am trying to create a dummy variable to identify …
Finding the right Instrument VariablesHi, i am examining relation between firm performance and instiutional ownership. I am now strugglin…
Creating a New Variable from a Dummy VariableI want to create a variable which counts the total number of people on a company board per year. The…
Subscribe to:
Post Comments (Atom)
0 Response to Change the lenght of a string
Post a Comment