I have a column in my my attribute table that contains a series of individually numbered locations. I wish to prefix all of these numbers with a letter, this letter will be the same for each of the values. E.g. 100, 200 and 300 would become A100, A200 and A300. I have a lot of data so simply going through and renaming would take a lot of time.
I have a feeling this would be achieved through the Field Calculator but unsure of which expression would be best for this?
-
Well Joshua, take your pick :). All answers should work.Joseph– Joseph2015年02月03日 11:47:28 +00:00Commented Feb 3, 2015 at 11:47
3 Answers 3
Simple solution:
'A' || "column name"
in a new field of type String
.
You can use:
concat('A', "your_column" )
Note: Your column must accept Strings so if your current column type is set to integer, you will have to create a new field in the Field Calculator and set it to String.
The expression would be, for example:
'A' || "someField"
someField would be your field that you want to use when updating and || is used to concatenate strings in QGIS.
EDIT:
Make sure the values are put in between single quotes and the field names are put in between double quotes!