Tuesday 24 July 2018

arcgis desktop - How to auto-create a schema.ini file for a .csv?


I have been given some data in a csv file, which I need to import into my ArcSDE geodatabase. ArcGIS is having problems recognizing the field types, and is not importing some data. It is recognizing some fields as Integer, when it should have been Text.


I know that we are supposed to create a schema.ini file, which will contain the appropriate data type, like in this question.


My csv file has over 50 fields, so I was wondering if there was a way to auto-create this schema.ini file, and then edit it to the correct data types, instead of creating this file by hand, from scratch.



Answer



One way to do this, is to get ArcGIS to create it for you.


Here is how you do it:



  1. Add the csv file to your ArcMap


  2. Export the table to csv format, at another location.

  3. ArcGIS will create the schema.ini file according to its best guess, at the new location.

  4. Copy the schema.ini file to the old location and edit the required columns, using a text editor of your choice.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...