I recently imported an Excel file and there are several variable names that end in a year as such:
longitudepublicschool2016 / latitudepublicschool2016
I'm wondering if there is a way to import them without the last four digits? Or is there a renaming convention that identifies numbers and removes them from variable names?
What I am doing afterwards is:
and I'm going to repeat this when new data comes out next year. Next year, they'll import as longitudepublicschool2017 and latitudepublicschool2017, so I would have to go into my .do file and change all mentions of 2016 into 2017 to conform to the new data It would be easier to just remove the year in the variable name to begin with.
longitudepublicschool2016 / latitudepublicschool2016
I'm wondering if there is a way to import them without the last four digits? Or is there a renaming convention that identifies numbers and removes them from variable names?
What I am doing afterwards is:
Code:
rename latitudepublicschool2016 latcod rename longitudepublicschool2016 loncod
Comment