<?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: Export Table to Table Conversion with specific fields example in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/export-table-to-table-conversion-with-specific/m-p/393928#M31175</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I am dealing with 7+ million records, so performance is a must.&amp;nbsp; mzcoyle's idea of insert cursor will take too long, and I made a script that worked based off of his example.&amp;nbsp; What kind of performance will I get with the append management?&amp;nbsp; The files that I am starting with are .txt files, and they are split into 2 (roughly 3.5 million per).&amp;nbsp; So I am also trying to figure out the fastest way to get them both together into one file into a file geodatabase.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;An insert cursor would be your best performance for this kind of operation. Can you post the code you have where you aren't getting the performance you require?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Is there way to set field length as well?&amp;nbsp; I didn't see it in the help page.&amp;nbsp; Most of the fields I am exporting are of the text variety, and the 255 length eats up way too much space and slows down other operations.&amp;nbsp; Thanks!!&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, length should be an editable property of a field object in field mapping.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;field.length = 10&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 29 Oct 2013 12:30:59 GMT</pubDate>
    <dc:creator>MathewCoyle</dc:creator>
    <dc:date>2013-10-29T12:30:59Z</dc:date>
    <item>
      <title>Export Table to Table Conversion with specific fields example</title>
      <link>https://community.esri.com/t5/python-questions/export-table-to-table-conversion-with-specific/m-p/393923#M31170</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I found the reference python code for a table to table conversion at: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/main/10.2/index.html#//001200000027000000" rel="nofollow" target="_blank"&gt;http://resources.arcgis.com/en/help/main/10.2/index.html#//001200000027000000&lt;/A&gt;&lt;SPAN&gt; with this code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy from arcpy import env env.workspace = "C:/data" arcpy.TableToTable_conversion("vegtable.dbf", "C:/output/output.gdb", "vegtable")&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I would like to export just a few specific fields from a .txt file.&amp;nbsp; I have done an exhaustive search as well as&amp;nbsp; tried many different iterations, but I have not been able to get this to work successfully. Does someone have a quick example of how I would set up exporting like 3 or 4 specific fields from the first table into the second table?&amp;nbsp; Thanks in advance!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Clinton&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Oct 2013 18:53:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/export-table-to-table-conversion-with-specific/m-p/393923#M31170</guid>
      <dc:creator>ClintonCooper1</dc:creator>
      <dc:date>2013-10-28T18:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: Export Table to Table Conversion with specific fields example</title>
      <link>https://community.esri.com/t5/python-questions/export-table-to-table-conversion-with-specific/m-p/393924#M31171</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Using table to table you would have to use field mappings to setup the conversion from source field to destination field. Alternatively you could use an insert cursor on a template with the field restrictions you want. You can find examples on these forums of field mapping.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's an example of me working through some issues I was having with field mapping. Should give you all the pieces you need for that route.&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/72269-field-map-problems"&gt;http://forums.arcgis.com/threads/72269-field-map-problems&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Oct 2013 19:48:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/export-table-to-table-conversion-with-specific/m-p/393924#M31171</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2013-10-28T19:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Export Table to Table Conversion with specific fields example</title>
      <link>https://community.esri.com/t5/python-questions/export-table-to-table-conversion-with-specific/m-p/393925#M31172</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;There is a easier way, if you don't need to get fancy with the nifty functions of field mappings:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you create a table for output and add just the fields you want and use Append_management with the NO_TEST option, only the fields with matching names get copied.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Oct 2013 21:27:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/export-table-to-table-conversion-with-specific/m-p/393925#M31172</guid>
      <dc:creator>curtvprice</dc:creator>
      <dc:date>2013-10-28T21:27:41Z</dc:date>
    </item>
    <item>
      <title>Re: Export Table to Table Conversion with specific fields example</title>
      <link>https://community.esri.com/t5/python-questions/export-table-to-table-conversion-with-specific/m-p/393926#M31173</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;There is a easier way, if you don't need to get fancy with the nifty functions of field mappings:&lt;BR /&gt;&lt;BR /&gt;If you create a table for output and add just the fields you want and use Append_management with the NO_TEST option, only the fields with matching names get copied.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I am dealing with 7+ million records, so performance is a must.&amp;nbsp; mzcoyle's idea of insert cursor will take too long, and I made a script that worked based off of his example.&amp;nbsp; What kind of performance will I get with the append management?&amp;nbsp; The files that I am starting with are .txt files, and they are split into 2 (roughly 3.5 million per).&amp;nbsp; So I am also trying to figure out the fastest way to get them both together into one file into a file geodatabase.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Oct 2013 12:16:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/export-table-to-table-conversion-with-specific/m-p/393926#M31173</guid>
      <dc:creator>ClintonCooper1</dc:creator>
      <dc:date>2013-10-29T12:16:13Z</dc:date>
    </item>
    <item>
      <title>Re: Export Table to Table Conversion with specific fields example</title>
      <link>https://community.esri.com/t5/python-questions/export-table-to-table-conversion-with-specific/m-p/393927#M31174</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Using table to table you would have to use field mappings to setup the conversion from source field to destination field. Alternatively you could use an insert cursor on a template with the field restrictions you want. You can find examples on these forums of field mapping.&lt;BR /&gt;&lt;BR /&gt;Here's an example of me working through some issues I was having with field mapping. Should give you all the pieces you need for that route.&lt;BR /&gt;&lt;A href="http://forums.arcgis.com/threads/72269-field-map-problems"&gt;http://forums.arcgis.com/threads/72269-field-map-problems&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there way to set field length as well?&amp;nbsp; I didn't see it in the help page.&amp;nbsp; Most of the fields I am exporting are of the text variety, and the 255 length eats up way too much space and slows down other operations.&amp;nbsp; Thanks!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Oct 2013 12:18:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/export-table-to-table-conversion-with-specific/m-p/393927#M31174</guid>
      <dc:creator>ClintonCooper1</dc:creator>
      <dc:date>2013-10-29T12:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: Export Table to Table Conversion with specific fields example</title>
      <link>https://community.esri.com/t5/python-questions/export-table-to-table-conversion-with-specific/m-p/393928#M31175</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I am dealing with 7+ million records, so performance is a must.&amp;nbsp; mzcoyle's idea of insert cursor will take too long, and I made a script that worked based off of his example.&amp;nbsp; What kind of performance will I get with the append management?&amp;nbsp; The files that I am starting with are .txt files, and they are split into 2 (roughly 3.5 million per).&amp;nbsp; So I am also trying to figure out the fastest way to get them both together into one file into a file geodatabase.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;An insert cursor would be your best performance for this kind of operation. Can you post the code you have where you aren't getting the performance you require?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Is there way to set field length as well?&amp;nbsp; I didn't see it in the help page.&amp;nbsp; Most of the fields I am exporting are of the text variety, and the 255 length eats up way too much space and slows down other operations.&amp;nbsp; Thanks!!&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, length should be an editable property of a field object in field mapping.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;field.length = 10&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Oct 2013 12:30:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/export-table-to-table-conversion-with-specific/m-p/393928#M31175</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2013-10-29T12:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: Export Table to Table Conversion with specific fields example</title>
      <link>https://community.esri.com/t5/python-questions/export-table-to-table-conversion-with-specific/m-p/393929#M31176</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;An insert cursor would be your best performance for this kind of operation. Can you post the code you have where you aren't getting the performance you require?&lt;BR /&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sorry let me explain, I created an example using field mappings.&amp;nbsp; It worked great, and had great performance.&amp;nbsp; My test file is 70,000 records (1/100th of my larger set), and it took around 10 seconds to export.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also tried the append method, and I have decided actually to go with that route, as 1.&amp;nbsp; the code is simpler (and allows to easily set the field length), 2.&amp;nbsp; performance is exactly the same, 3. allows me to take the two files that my data comes in, and can easily merge them together into one. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You were saying insert cursor would still be faster then both these methods?&amp;nbsp; Do you have an example that I could look at to play around with?&amp;nbsp; Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 29 Oct 2013 12:52:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/export-table-to-table-conversion-with-specific/m-p/393929#M31176</guid>
      <dc:creator>ClintonCooper1</dc:creator>
      <dc:date>2013-10-29T12:52:17Z</dc:date>
    </item>
  </channel>
</rss>

