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.

I would like to convert a column in a spreadsheet from a double to a string so I can join the data with a shp file. What is the easiest way to do it?

share|improve this question

5 Answers 5

up vote 4 down vote accepted

To do this in ArcGIS:

  • Import spreadsheet to Geodatabase (Import Table)
  • Add a new field to table (change type to text)
  • Open ArcMap and add table to TOC
  • Right click on the new field's column header and select "Field Calculator"
  • Scroll down the field list to find your "double" source field
  • double click the field (should appear in the bottom pane)
  • click OK to populate column with values

I am suggesting to do this in ArcGIS because I think you want to use this field as a "join"? If so, add the shapefile to ArcMap, right click on the layer and select "Joins and Relates".

share|improve this answer

Usually it suffices to force the field value in the first data row to be a string, for then the software is obliged to treat the entire column as string data. An easy way is to insert a single quote (') mark at the beginning of the value.

share|improve this answer
1  
by far the easiest solution. I wish there were a way to force other data types in the same manner. –  Brad Nesom May 18 '11 at 13:51
    
@Brad You can usually do so by formatting columns (although whether ArcGIS will recognize this formatting information is another matter). For detailed instructions (and the reasons behind them) see my page at quantdec.com/SYSEN597/GTKAV/section4/chapter_15a.htm#Recipe . –  whuber May 18 '11 at 14:30

Microsoft has a page dedicated to this with a range of solutions:

http://support.microsoft.com/kb/291047

share|improve this answer
    
This page seems to do the reverse of what is wanted: it shows how to convert text to numbers. –  whuber May 18 '11 at 14:30

USE ArcCatalog. Create a GDB, import the table (single) into it. Below in the fields you can right click on the field you want to change to STRING, and simply change the type to STRING for that field. Easy peasey.

(*it seems that this may only work if the field is empty)

share|improve this answer

You can use the CONCATENATE function (if using Excel) to form a single quoted string.

e.g.: =CONCATENATE("'",A1,"'")

where this formula refers to the first row, and can be copied to other rows as well.

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.