I have a shapefile I made in QGIS 1.7.4. One of the fields is a String of length 80. I'd like to make the field accept longer stings, but I can't figure out how to change its length. How do I do this?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
Here is a solution which surprised me that it worked!!!
Warning: first make a backup.This is an experiment though it worked for me just now..
open the .dbf of the particular shapefile using OpenOffice Calc application. Change value from 80 to whatever value you want. Please see the image below. Surprising thing is these field definitions were not visible in Excel..Advantage of being Open!!
To my knowledge, you cannot alter the length of shapefile fields in QGIS. Recommend creating a new field:
If there is already data in the old field, use field calculator to populate the new field:
Guide to changing the column size for the Attribute table in QGIS
*You will need to install Table Manager Plugin.
Scro's solution as more thoroughly explained by YP-kun just worked for me. One change now with QGIS 3.4, no need to use Table Manager for YP-kun's steps 10 and 11 (to delete the old column). In fact, Table Manager apparently is no more as it is now not available in Plugin Manager. Now, after YP-kun's steps 1-9, you can go to Layer Properties for the layer (double click on the layer in the Layer panel, or right click on it and click on Properties) > Source Fields > click the edit button > then select the old field you want to delete > click Delete Field button > then edit button again to close editing > save your changes. Seems like a lot to go through to change the length of a single field in a single layer, but so be it. We are lucky to have QGIS and thank you very much to those of you who develop it and its plugins.