I have an ASCII Grid file that states the following in its header:

ncols 2205
nrows 653
nodata_value -9999

But when going through the rows, the max number of cols is 12 and the number of rows is around 83,000. It seems like the rows are wrapping around but I am not sure why.

ArcMap ingests correctly, but I am trying to understand what is going on in the file.

Has anybody seen this before?

  • Rows wrap around because they can. It's only necessary that ncols x nrows total values are present after the header.
    – Vince
    Aug 28, 2017 at 22:20
  • @Vince So it doesnt matter?
    – pstatix
    Aug 29, 2017 at 0:23
  • 1
    You are probably looking at the data in a text editor with word wrap on. Read it into a gis and look at image dimensions there. Aug 29, 2017 at 1:30

1 Answer 1


If you haven't encountered an error, and the result appears to be correct, then the ASCII to Raster (Conversion) utility is working as intended. As the documentation states (cherry-picked highlights):

  • The structure of the ASCII file consists of header information containing a set of keywords, followed by cell values in row-major order.
  • Cell values should be delimited by spaces. No carriage returns are necessary at the end of each row in the ASCII file. The number of columns in the header is used to determine when a new row begins.
  • The number of cell values contained in the file must be equal to the number of rows times the number of columns, or an error will be returned.

So, if you have the right number of cells, and they're presented in row-major order, it doesn't matter if some additional newlines are present.

  • So it appears it counts the number of cells. Interesting!
    – pstatix
    Aug 29, 2017 at 0:54

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.