1

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?

5

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".

7

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.

  • 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
1

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.

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

0

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.

0

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

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

  • 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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