I,m trying to make a substring on a column in a table that looks like first column in image. I would like to create one column for numeric values, one for country and one for municipality. I think i should use substring the substring function (substring, text, start, stop). But how could i get substring to know that first blank spase minus one position defines where to stop for the numeric values, for country to start after first blank and stop one position before second blank space and for municipality start at first position after second blank space and set stop at column end? Could this be done in R and could i get example code to solve this?
I have not find a good solution to this but i would like the result to look like the image with the first column and the one column for number, one for country and one for municipality. as in the image
Arne Olsson is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.