3

I have a CSV table with millions of records. When I imported in into dbase via ArcMap, those inital zeros in a certain field just went away. E.g. one field show be "01001", but it displayed as "1001".

How can I keep the inital zeros?

2 Answers 2

3

You can put a schema.ini file in the same folder as your CSV file. In it define the fields you need leading zeros as text fields.

http://msdn.microsoft.com/en-us/library/ms709353%28v=vs.85%29.aspx

http://gisnuts.com/terra/blog/2012/06/14/using-the-schemaini-file-to-import-a-csv-file-into-arcgis

2
  • The format is correct. But when imported, it raised error 999999 and failed to convert from csv to dbf. Have you ever met similar situation? Maybe my csv is to large?(300MB, >5 million records)
    – Mingshu
    Commented Nov 13, 2013 at 18:39
  • 300MB doesn't sound like too much but you can test that pretty easily: open the CSV, delete all but the first few records, save it as a different filename, then try importing it again. If it works, size may be the problem.
    – Dan C
    Commented Nov 13, 2013 at 18:43
0

If your values are stored as integers, the leading zeroes are dropped.

You can either make a schema.ini file, or add a new "string" field and calculate it with the appropriate field.

There is also the option of right clicking the field -> number format -> custom -> and adding in your own zeroes.

1
  • The format issue is solved by adding schema.ini file. But when imported, it raised error 999999 and failed to convert from csv to dbf. Have you ever met similar situation? Maybe my csv is to large?(300MB, >5 million records)
    – Mingshu
    Commented Nov 13, 2013 at 18:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.