Hello,

I am trying to import a .shp shapefile containing English local authorities into Stata using shp2dta user written command, but I get an error message saying "long invalid varname" (signalling that the shapefile dataset includes a variable named "long", which is an invalid variable name within Stata - if I have understood correctly).

Is there a way of amending the varname within the shp2dta command to successfully import it?

Or is it necessary to use a workaround by e.g. importing into R to rename/delete the variable called "long" (as noted by Carolin Thol in this previous post: https://www.statalist.org/forums/for...files-in-stata)? If anyone has successfully done this and is happy to share steps, that would be much appreciated (I have managed to upload into R, but it does not display like a "normal" dataset so I have not found a way of amending the variable).

Many thanks!
Francesca