In QGIS I have two words e.g. the species name I would like to extract and put in its own column and then extract each of the numbers individually into its own column that represents DBH, height and spread. I have had a look at a few examples here and I cannot get it to work for me.
Extracting text from column in attribute table using QGIS
attribute-tableextractfields-attributesqgis
Best Answer
Working with tree data is right up my alley! I'm sure you could use expressions in the field calculator to do this, but if you would like to use pyqgis, you can add and populate all four fields at once. I chose this method partly because it looks as though there are some inconsistencies in your data (at least one row has commas separating the measurement values).
As a general rule, I always advise to make a backup copy of your layer first, as this script will permanently edit your data.
Open the Python console (Ctrl+Alt+P) or click the icon![enter image description here](https://i.stack.imgur.com/IHbp4.png)
Open a new editor by clicking this icon:
Script
The image below is of the script in my Python console.
You should get the following result (fields added to your layer and populated with the extracted values):