<?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: ASCIIToRaster_conversion not working in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/asciitoraster-conversion-not-working/m-p/85302#M6730</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can you edit your post and enclose your script in CODE tags. See &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/48475-Please-read-How-to-post-Python-code?p=166129&amp;amp;viewfull=1"&gt;this post&lt;/A&gt;&lt;SPAN&gt; if you're not sure how.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Mar 2013 10:13:44 GMT</pubDate>
    <dc:creator>Luke_Pinner</dc:creator>
    <dc:date>2013-03-14T10:13:44Z</dc:date>
    <item>
      <title>ASCIIToRaster_conversion not working</title>
      <link>https://community.esri.com/t5/python-questions/asciitoraster-conversion-not-working/m-p/85301#M6729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Dear all&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;here is my syntax &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
import arcpy
import os
dir_name = "J:/BIOCLIM_Data/a1b_scenario/csiro_mk3_0_sres_a1b_2020s_bio_30s_no_tile_asc"
for filename in os.listdir(dir_name):
&amp;nbsp;&amp;nbsp;&amp;nbsp; if not filename.endswith("%s.asc"): continue
&amp;nbsp;&amp;nbsp;&amp;nbsp; full_path = os.path.join(dir_name, filename)
&amp;nbsp;&amp;nbsp;&amp;nbsp; inASCII = '%s.asc' % (full_path,)
&amp;nbsp;&amp;nbsp;&amp;nbsp; outRaster = '%s.img' % (full_path,)
&amp;nbsp;&amp;nbsp;&amp;nbsp; rasterType = "FLOAT"
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.ASCIIToRaster_conversion(inASCII, outRaster, rasterType)
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't know where it went wrong, but is not working &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;out put is &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
Traceback (most recent call last):
&amp;nbsp; File "C:\Documents and Settings\Madan K Suwal\Desktop\R to A.py", line 7, in &amp;lt;module&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.ASCIIToRaster_conversion(inASCII, outRaster, rasterType)
&amp;nbsp; File "C:\Program Files\ArcGIS\Desktop10.0\arcpy\arcpy\conversion.py", line 1615, in ASCIIToRaster
&amp;nbsp;&amp;nbsp;&amp;nbsp; raise e
ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000865: Input ASCII raster file: bio_1.asc does not exist.
Failed to execute (ASCIIToRaster).
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;I am very new in python, actually just modified the syntax from online sources, so I don't know what wrong with it&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to convert about 150 ASCII files to Raster and define projection WGS 1984 to them at the same time&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to automate the process, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am expecting this forum's support, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;any kind help is appreciated&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;thanking you&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;madan k suwal&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Mar 2013 09:35:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/asciitoraster-conversion-not-working/m-p/85301#M6729</guid>
      <dc:creator>Madan_KrishnaSuwal</dc:creator>
      <dc:date>2013-03-14T09:35:27Z</dc:date>
    </item>
    <item>
      <title>Re: ASCIIToRaster_conversion not working</title>
      <link>https://community.esri.com/t5/python-questions/asciitoraster-conversion-not-working/m-p/85302#M6730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can you edit your post and enclose your script in CODE tags. See &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/48475-Please-read-How-to-post-Python-code?p=166129&amp;amp;viewfull=1"&gt;this post&lt;/A&gt;&lt;SPAN&gt; if you're not sure how.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Mar 2013 10:13:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/asciitoraster-conversion-not-working/m-p/85302#M6730</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2013-03-14T10:13:44Z</dc:date>
    </item>
  </channel>
</rss>

