..... f2 = open("e:/crs/currentgdb/schema.ini","w") f2.write("""[owners.csv] Format=CSVDelimited ColNameHeader=True col1=TTL_TITLE_NO Text Width 20 col2=OWNERS Text Width 120""") f2.close() print "uses schema.ini" arcpy.conversion.TableToTable(csvOwners,ws,"owners")
You have not specified how you are reading in the text file.Have you had a look at the schema.ini specification? This is a Microsoft standard for defining the schema for reading in text files.It works really well for loading text files into a geodatabase table because you can rename, set input widths, types to make the simple table to table tool work very well. This avoids a lot of complex coding opening a file and unpicking the components.
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.