<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Raster to ascii in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/raster-to-ascii/m-p/578727#M19191</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Guys, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've been trying this out and need to do it pro grammatically as I have a lot of rasters I am iterating through to convert to .asc.&amp;nbsp; I tried specifying this in the raster to ASCII tool but then I end up with %filename%.asc.TXT&amp;nbsp; I also tried the suggestion above of using calculate value.&amp;nbsp; I get this error when I run it:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Executing: CreateEnvLayersFile C:\Users\OJB\Desktop\BurdsGIS\CollabPapers\Mimeticus\WorldClim\asc2 C:\Users\OJB\Desktop\BurdsGIS\CollabPapers\Mimeticus\WorldClim\tmin_clip NOT_RECURSIVE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Start Time: Thu Dec 06 14:12:56 2012&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Executing (Iterate Rasters): IterateRasters C:\Users\OJB\Desktop\BurdsGIS\CollabPapers\Mimeticus\WorldClim\tmin_clip # # NOT_RECURSIVE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Start Time: Thu Dec 06 14:12:57 2012&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Succeeded at Thu Dec 06 14:12:57 2012 (Elapsed Time: 0.00 seconds)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Executing (Raster to ASCII): RasterToASCII C:\Users\OJB\Desktop\BurdsGIS\CollabPapers\Mimeticus\WorldClim\tmin_clip\clip_tmin_1 C:\Users\OJB\Desktop\BurdsGIS\CollabPapers\Mimeticus\WorldClim\asc2\e_clip_tmin_1.TXT&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Start Time: Thu Dec 06 14:12:57 2012&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Succeeded at Thu Dec 06 14:12:59 2012 (Elapsed Time: 2.00 seconds)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Executing (Calculate Value): CalculateValue newext("C:\Users\OJB\Desktop\BurdsGIS\CollabPapers\Mimeticus\WorldClim\asc2\e_clip_tmin_1.txt","asc") "def newext(file,ext):\n&amp;nbsp;&amp;nbsp;&amp;nbsp; import os\n&amp;nbsp;&amp;nbsp;&amp;nbsp; newfile =&amp;nbsp; os.path.splitext(file)[0] + "." + ext\n&amp;nbsp;&amp;nbsp;&amp;nbsp; os.rename(file,newfile)" Variant&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Start Time: Thu Dec 06 14:12:59 2012&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 000539: Error running expression: newext("C:\Users\OJB\Desktop\BurdsGIS\CollabPapers\Mimeticus\WorldClim\asc2\e_clip_tmin_1.txt","asc") &amp;lt;type 'exceptions.WindowsError'&amp;gt;: [Error 123] The filename, directory name, or volume label syntax is incorrect&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (Calculate Value).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed at Thu Dec 06 14:12:59 2012 (Elapsed Time: 0.00 seconds)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (CreateEnvLayersFile).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed at Thu Dec 06 14:12:59 2012 (Elapsed Time: 3.00 seconds)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Dec 2012 17:13:50 GMT</pubDate>
    <dc:creator>OliverBurdekin</dc:creator>
    <dc:date>2012-12-06T17:13:50Z</dc:date>
    <item>
      <title>Raster to ascii</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/raster-to-ascii/m-p/578721#M19185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to convert a raster to ascii in ArcMap 10, but I can only get an output with the .txt file extension - even when I specify .asc&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;can anyone help?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;thanks heaps,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;April&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Apr 2012 04:19:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/raster-to-ascii/m-p/578721#M19185</guid>
      <dc:creator>AprilReside</dc:creator>
      <dc:date>2012-04-02T04:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: Raster to ascii</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/raster-to-ascii/m-p/578722#M19186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;why don't you just rename it outside of arcmap?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Apr 2012 11:55:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/raster-to-ascii/m-p/578722#M19186</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2012-04-02T11:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: Raster to ascii</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/raster-to-ascii/m-p/578723#M19187</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Are you sure it isn't appending .TXT to the end of your output? You need to specify the extension if you don't want it to be text directly in the tool parameter.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Apr 2012 13:31:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/raster-to-ascii/m-p/578723#M19187</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2012-04-02T13:31:10Z</dc:date>
    </item>
    <item>
      <title>Re: Raster to ascii</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/raster-to-ascii/m-p/578724#M19188</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I am trying to convert a raster to ascii in ArcMap 10, but I can only get an output with the .txt file extension - even when I specify .asc&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Esri has named this .txt so it easily opens in a text editor from Windows (a good call, IMHO). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you need the .asc extension for some reason, you could use the Calculate Value tool to rename the file in ModelBuilder with a short python script:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;expression: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;newext(r"%output ascii txt%","asc")&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;code: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def newext(file,ext):
&amp;nbsp;&amp;nbsp;&amp;nbsp; import os
&amp;nbsp;&amp;nbsp;&amp;nbsp; newfile =&amp;nbsp; os.path.splitext(file)[0] + "." + ext
&amp;nbsp;&amp;nbsp;&amp;nbsp; os.rename(file,newfile)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:52:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/raster-to-ascii/m-p/578724#M19188</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2021-12-12T00:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: Raster to ascii</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/raster-to-ascii/m-p/578725#M19189</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks for the help!&amp;nbsp; It seems that changing the extension .txt to .asc outside of ArcMap worked fine.&amp;nbsp; Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Apr 2012 02:53:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/raster-to-ascii/m-p/578725#M19189</guid>
      <dc:creator>AprilReside</dc:creator>
      <dc:date>2012-04-03T02:53:53Z</dc:date>
    </item>
    <item>
      <title>Re: Raster to ascii</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/raster-to-ascii/m-p/578726#M19190</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;April&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The default extension in the RasterToASCII GP tool is .txt, however, you can also use .asc&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;These are the 2 extensions to use. If you create it using the .asc extension then it becomes a supported raster data format, i.e. you can use it in ArcGIS as any other raster dataset (no need to then use ASCIIToRaster).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please can you share a screenshot of the dialog or are you doing it via scripting.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Steve&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Apr 2012 20:47:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/raster-to-ascii/m-p/578726#M19190</guid>
      <dc:creator>SteveLynch</dc:creator>
      <dc:date>2012-04-03T20:47:16Z</dc:date>
    </item>
    <item>
      <title>Re: Raster to ascii</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/raster-to-ascii/m-p/578727#M19191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Guys, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've been trying this out and need to do it pro grammatically as I have a lot of rasters I am iterating through to convert to .asc.&amp;nbsp; I tried specifying this in the raster to ASCII tool but then I end up with %filename%.asc.TXT&amp;nbsp; I also tried the suggestion above of using calculate value.&amp;nbsp; I get this error when I run it:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Executing: CreateEnvLayersFile C:\Users\OJB\Desktop\BurdsGIS\CollabPapers\Mimeticus\WorldClim\asc2 C:\Users\OJB\Desktop\BurdsGIS\CollabPapers\Mimeticus\WorldClim\tmin_clip NOT_RECURSIVE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Start Time: Thu Dec 06 14:12:56 2012&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Executing (Iterate Rasters): IterateRasters C:\Users\OJB\Desktop\BurdsGIS\CollabPapers\Mimeticus\WorldClim\tmin_clip # # NOT_RECURSIVE&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Start Time: Thu Dec 06 14:12:57 2012&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Succeeded at Thu Dec 06 14:12:57 2012 (Elapsed Time: 0.00 seconds)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Executing (Raster to ASCII): RasterToASCII C:\Users\OJB\Desktop\BurdsGIS\CollabPapers\Mimeticus\WorldClim\tmin_clip\clip_tmin_1 C:\Users\OJB\Desktop\BurdsGIS\CollabPapers\Mimeticus\WorldClim\asc2\e_clip_tmin_1.TXT&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Start Time: Thu Dec 06 14:12:57 2012&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Succeeded at Thu Dec 06 14:12:59 2012 (Elapsed Time: 2.00 seconds)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Executing (Calculate Value): CalculateValue newext("C:\Users\OJB\Desktop\BurdsGIS\CollabPapers\Mimeticus\WorldClim\asc2\e_clip_tmin_1.txt","asc") "def newext(file,ext):\n&amp;nbsp;&amp;nbsp;&amp;nbsp; import os\n&amp;nbsp;&amp;nbsp;&amp;nbsp; newfile =&amp;nbsp; os.path.splitext(file)[0] + "." + ext\n&amp;nbsp;&amp;nbsp;&amp;nbsp; os.rename(file,newfile)" Variant&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Start Time: Thu Dec 06 14:12:59 2012&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ERROR 000539: Error running expression: newext("C:\Users\OJB\Desktop\BurdsGIS\CollabPapers\Mimeticus\WorldClim\asc2\e_clip_tmin_1.txt","asc") &amp;lt;type 'exceptions.WindowsError'&amp;gt;: [Error 123] The filename, directory name, or volume label syntax is incorrect&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (Calculate Value).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed at Thu Dec 06 14:12:59 2012 (Elapsed Time: 0.00 seconds)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed to execute (CreateEnvLayersFile).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Failed at Thu Dec 06 14:12:59 2012 (Elapsed Time: 3.00 seconds)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Dec 2012 17:13:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/raster-to-ascii/m-p/578727#M19191</guid>
      <dc:creator>OliverBurdekin</dc:creator>
      <dc:date>2012-12-06T17:13:50Z</dc:date>
    </item>
  </channel>
</rss>

