4

I want to update the string length for a shapefile layer in QGIS. I've tried opening up Layer Properties and clicking edit but it won't let me change it manually. Also I've tried using the field calculator but I can't seem to get my head around it. I can create a new comment field (see "Comments_1"), but can't update the existing "Comments" to a character length of 254. The screenshot shows both windows I tried in.

enter image description here

0

2 Answers 2

7

If you want to change the length of a field you need to use the “Refactor fields” tool.

0
5

As in the comment from Binx, the main bit here is to calculate a new field and use the input boxes to set the field type and length:

enter image description here

Using 'length()' in the expression will return the actual number of characters in x, not reset a field to that length: enter image description here

0

Not the answer you're looking for? Browse other questions tagged or ask your own question.