I have an unwanted space in my data attribute field after copying the data as you see below.
Is there any way to remove it automatically (i.e. when I select another attribute field)?
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
Depending on your workflow and based on other suggestions/answer to use the Trim function, I would approach removing the space(s) in the following way. Once the data copying to the attribute table is complete, I would simply use Update existing field from the Field calculator. Once complete simply save.
I tried it on QGIS 3.10.12 and it work. (Pls note create a back up before you update).
If you want to use
trim() in default value, you have to generate a new field, for example
"span_name_2", where you write value with space.
And setting in
"span_name" field as default value:
so automatically in 'span_name' is memorized text without space.