Does anyone know of a way to capitalize the first letter of each word in a field in an attribute table? I am doing this in QGIS. I know of field calculations to change all the words to Lower or Upper, but I would like to be able to have the first letter Capitalized of each word, and the remaining letters lower cased. I know how to do this manually, but I am looking for an automated way. Similar to the Proper command in Excel.
Thanks...
Answer
Using the python field calculator:
http://hub.qgis.org/wiki/17/Using_Python_to_calculate_attribute_values_with_'fieldpyculator'
You should be able to us the .title() method on your strings:
https://stackoverflow.com/questions/3728655/python-titlecase-a-string-with-exceptions
Edit:
Assuming the attribute field you want to change is "FIELD", the sintax to use is:
value = .title()
No comments:
Post a Comment