How To: Convert a grid to a text file of x-, y- and z-values of the center of each cell with the Grid to Features function in the Spatial Analyst toolbar
While the ArcToolbox Conversion tool 'Grid to ASCII' will produce an ASCII file that stores the z-values of each cell of a grid, there is no x and y coordinate for the center of each cell. This article describes a method that will produce a text file that contains the x coordinate, the y coordinate, and the z-value of the center of every cell a grid. Spatial Analyst is required to perform this operation.
The advantages of using this method are that it provides control over the precision of the values returned for the x and y coordinates and the format of the txt file generated. The disadvantages to this method are that only integer grids can be used, because floating-point grids do not have a VAT, and it can be time consuming.
These steps require the Spatial Analyst extension to be active and the Spatial Analyst toolbar to be turned on.
Add the grid to ArcMap
Select the Convert option under the Spatial Analyst menu.
Select the Raster to features option.
Select the field for the z-values in the text file. Typically, this is the Value field.
Set the Output Geometrytype to points.
Select an output shapefile or feature class.
Click OK. This generates a layer with a point at the center of each cell. The value in the field GRID_CODE is the z-value of the cell.