I NEED PUT THE COORDINATE AND THE WORD : NOMBRE, LIKE: 57485.258 NOMBRE
POINT_X and POINT_Y are both numeric type fields. You will need to add two new fields of String type in order to concatenate the word NOMBRE to it.
Add two new string type field, naming them as you wish.
Then in the field calculator you can copy and paste the following for each of the new fields:
str<SPAN class="punctuation token">(</SPAN>!POINT_X!<SPAN class="punctuation token">)</SPAN><SPAN class="operator token">+</SPAN><SPAN class="string token">' '</SPAN><SPAN class="operator token">+</SPAN><SPAN class="string token">'NOMBRE'</SPAN> str<SPAN class="punctuation token">(</SPAN>!POINT_Y!<SPAN class="punctuation token">)</SPAN><SPAN class="operator token">+</SPAN><SPAN class="string token">' '</SPAN><SPAN class="operator token">+</SPAN><SPAN class="string token">'NOMBRE'</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
This casts the value of each variable to a string and then puts a space between the value and NOMBRE. You may need to set the format of the POINT_X and POINT_Y fields to the number of decimal places you want to display.
thanks for your fast and effective answer
Ok ok
Armando Freites, please mark one of the responses as Correct to close out your question. If multiple people gave you good answers, pick the one that helped the most and mark it correct while marking the others as helpful.
Very good, it´s working. Thanks
To avoid whether you need cast things to strings, learn the python "format" mini-language. It can all be done on 1 line and is even more powerful than its sibling the f-string.
"{}
<SPAN class="string token">"{} {}"</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'a string'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="comment token"># ---- implicit order</SPAN> <SPAN class="string token">'a string 1'</SPAN> <SPAN class="string token">"{1} {0}"</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'a string'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="comment token"># ---- explicit order </SPAN> <SPAN class="string token">'1 a string'</SPAN> <SPAN class="string token">"{}{}{}"</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation token">(</SPAN><SPAN class="string token">'stuff'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="string token">" in between "</SPAN><SPAN class="operator token">*</SPAN><SPAN class="number token">3</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="punctuation token">[</SPAN><SPAN class="string token">'a, b'</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">1</SPAN><SPAN class="punctuation token">,</SPAN> <SPAN class="number token">2.0</SPAN><SPAN class="punctuation token">]</SPAN><SPAN class="punctuation token">)</SPAN> <SPAN class="comment token"># ---- it can do anything</SPAN> <SPAN class="string token">"stuff in between in between in between ['a, b', 1, 2.0]"</SPAN><SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.