Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

How would I populate a text field with double quotes using the Field Calculator. For example, I want to populate a field as 24". Is there a way to populate fields using the field calculator with this value? If I use "24"", I get an error because of the two double quotes.

Thanks in advance!

share|improve this question
    
Found the answer... "24\"" ... need to escape out the double quote. –  boyle.matt Apr 25 at 18:59
    
Thanks for the quick replies, didn't know you could use single quotes with python, easy solution! –  boyle.matt Apr 25 at 19:03
    
In the VB parser it's "24""" that's "" to insert a " and " to finish so 3x". Another option is chr(42) where 42 is the ASCII code for " so "24" & chr(42) –  Michael Miles-Stimson Apr 26 at 2:49

2 Answers 2

Change the parser to Python using the radio button at the top of the field calculator window, then use single-quotes to enclose your text:

'24"'

Python allows you to use either single- or double-quotes to enclose a string. If you wanted to use an apostrophe in your text field, you would use double-quotes instead:

"Owner's"
share|improve this answer

with python, you can use either " " or ' ' to identify your text

so you could do it like this :

'24"'

but the best method if you don't want to play with \' and \" when you have both ' and " in your string, is to use the triple """

""" 24's" """

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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