<?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: Select Field to export in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/select-field-to-export/m-p/637717#M49696</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you follow the model steps and select only the field you want in the "Export Feature Attribute to ASCII", it should only export that particular field (plus x and y, which you can remove by editing that tool's script).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, say you have a table with 20 fields... you can apply your filter (where some attribute = "&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;P-1 Feeder"), then select only the [&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;TWACs_Number] field in the fields list within the "Export Feature Attribute to ASCII" tool. When you export, you should only have a CSV with the [TWAVs_Number] field and all of its attributes, where the feeder assignment = "P-1 Feeder".&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;I was able to get this to work both with making a feature layer, and by skipping this step (making a feature selection update, like in the model).&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Dec 2015 18:27:28 GMT</pubDate>
    <dc:creator>ChrisSmith7</dc:creator>
    <dc:date>2015-12-03T18:27:28Z</dc:date>
    <item>
      <title>Select Field to export</title>
      <link>https://community.esri.com/t5/python-questions/select-field-to-export/m-p/637712#M49691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to write a model and/or python script that will select specific attributes and export a particular field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;I have a feature class of 10,000 electric meters and each meter is assigned a feeder assignment. I want to be able to select all of the rows that has a specific feeder assignment "P-1 Feeder" and than select only those in the "TWACs_Number" field and export ONLY the TWACs_Number field to a .CSV file so when someone opens the file, they see only the attributes from that one field, but nothing else. I already have the process to export but having a hard time getting the rest of it. I need to build a model/script that I can have run every night.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Dec 2015 17:45:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-field-to-export/m-p/637712#M49691</guid>
      <dc:creator>ModernElectric</dc:creator>
      <dc:date>2015-12-03T17:45:06Z</dc:date>
    </item>
    <item>
      <title>Re: Select Field to export</title>
      <link>https://community.esri.com/t5/python-questions/select-field-to-export/m-p/637713#M49692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried creating a table view from the selection with only that field marked for inclusion, then exporting your CSV?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;UPDATE:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually, try using the "Make Feature Layer" tool - add your selection query, then choose only the field you want, e.g.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" height="213" src="https://community.esri.com/legacyfs/online/151517_pastedImage_0.png" style="width: 431px; height: 213.415px;" width="431" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That should output a temporary layer (for the session) you can then export.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Dec 2015 17:52:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-field-to-export/m-p/637713#M49692</guid>
      <dc:creator>ChrisSmith7</dc:creator>
      <dc:date>2015-12-03T17:52:25Z</dc:date>
    </item>
    <item>
      <title>Re: Select Field to export</title>
      <link>https://community.esri.com/t5/python-questions/select-field-to-export/m-p/637714#M49693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After you do this, you can use "Export Feature Attribute to ASCII" to get a CSV, e.g.:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="151519" class="image-1 jive-image" height="307" src="https://community.esri.com/legacyfs/online/151519_pastedImage_1.png" style="width: 450px; height: 307.016px;" width="450" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After you get your model set-up, you can export the Python script and schedule a Windows task to have it run every night. Here's some info on that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://blogs.esri.com/esri/arcgis/2013/07/30/scheduling-a-scrip/" title="http://blogs.esri.com/esri/arcgis/2013/07/30/scheduling-a-scrip/"&gt;Scheduling a Python script or model to run at a prescribed time | ArcGIS Blog&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may notice the "Export Feature Attribute to ASCII" includes x,y data in the output, in addition to your chosen field... you can open the script and edit this out, if needed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Dec 2015 18:07:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-field-to-export/m-p/637714#M49693</guid>
      <dc:creator>ChrisSmith7</dc:creator>
      <dc:date>2015-12-03T18:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: Select Field to export</title>
      <link>https://community.esri.com/t5/python-questions/select-field-to-export/m-p/637715#M49694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One last suggestion, rather than using the "Make Feature Layer" tool, you can simply use the "Select Layer By Attribute" tool:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" height="211" src="https://community.esri.com/legacyfs/online/151497_pastedImage_0.png" style="width: 309px; height: 210.818px;" width="309" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then make your output column selection in the "Feature Attribute to ASCII" tool. So, you would have your input table, then you'd apply the query, then you'd export the CSV:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" height="246" src="https://community.esri.com/legacyfs/online/151498_pastedImage_5.png" style="width: 490px; height: 245.79px;" width="490" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Dec 2015 18:17:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-field-to-export/m-p/637715#M49694</guid>
      <dc:creator>ChrisSmith7</dc:creator>
      <dc:date>2015-12-03T18:17:52Z</dc:date>
    </item>
    <item>
      <title>Re: Select Field to export</title>
      <link>https://community.esri.com/t5/python-questions/select-field-to-export/m-p/637716#M49695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is kind of what I am looking for. However, when I open the Excel file, there are a number of fields included even though I selected only (1) field in the "Visible" column of the Make Feature Layer tool. Not sure why that is? I have around 20 fields and only need to export the attributes selected from (1) of those fields. &lt;/P&gt;&lt;P&gt;Basically, I am saying find all of the attributes from the CIRCUIT_ID field that match "F-1 Feeder" and export the attributes under the TWACs_NUMBER field and only export the TWACs_NUMBER field. Somehow, it is not working exactly that way. Am I missing something or is there a setting wrong on my part? So far, you seem to be on the right track but I must be doing something wrong. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Dec 2015 18:19:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-field-to-export/m-p/637716#M49695</guid>
      <dc:creator>ModernElectric</dc:creator>
      <dc:date>2015-12-03T18:19:56Z</dc:date>
    </item>
    <item>
      <title>Re: Select Field to export</title>
      <link>https://community.esri.com/t5/python-questions/select-field-to-export/m-p/637717#M49696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you follow the model steps and select only the field you want in the "Export Feature Attribute to ASCII", it should only export that particular field (plus x and y, which you can remove by editing that tool's script).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, say you have a table with 20 fields... you can apply your filter (where some attribute = "&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;P-1 Feeder"), then select only the [&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;TWACs_Number] field in the fields list within the "Export Feature Attribute to ASCII" tool. When you export, you should only have a CSV with the [TWAVs_Number] field and all of its attributes, where the feeder assignment = "P-1 Feeder".&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif;"&gt;I was able to get this to work both with making a feature layer, and by skipping this step (making a feature selection update, like in the model).&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Dec 2015 18:27:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-field-to-export/m-p/637717#M49696</guid>
      <dc:creator>ChrisSmith7</dc:creator>
      <dc:date>2015-12-03T18:27:28Z</dc:date>
    </item>
    <item>
      <title>Re: Select Field to export</title>
      <link>https://community.esri.com/t5/python-questions/select-field-to-export/m-p/637718#M49697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One out of ordinary is to use&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-data-access/tabletonumpyarray.htm" title="http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-data-access/tabletonumpyarray.htm"&gt;TableToNumPyArray—Help | ArcGIS for Desktop&lt;/A&gt; just specifying the fields to keep&lt;/P&gt;&lt;P&gt;then back to &lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-data-access/numpyarraytotable.htm" title="http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-data-access/numpyarraytotable.htm"&gt;NumPyArrayToTable—Help | ArcGIS for Desktop&lt;/A&gt;&lt;/P&gt;&lt;P&gt;to get it backinto Arc*&lt;/P&gt;&lt;P&gt;However, you can even skip that last step since numpy and python have the capability to get data into a variety of formats either directly (ie txt or csv) or via other modules.&lt;/P&gt;&lt;P&gt;You would have to make a script to use ina model however... unless you are ultimately getting the model to formulate&amp;nbsp; a script&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Dec 2015 18:49:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-field-to-export/m-p/637718#M49697</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2015-12-03T18:49:43Z</dc:date>
    </item>
    <item>
      <title>Re: Select Field to export</title>
      <link>https://community.esri.com/t5/python-questions/select-field-to-export/m-p/637719#M49698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;is there anyway to work on feature layer instead of feature class . it is powerful tool&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Jun 2019 15:30:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/select-field-to-export/m-p/637719#M49698</guid>
      <dc:creator>AddisalemAbera</dc:creator>
      <dc:date>2019-06-19T15:30:55Z</dc:date>
    </item>
  </channel>
</rss>

