1 Reply Latest reply on Mar 9, 2012 10:53 AM by m.gasior

    Using Python to find DBF data (im a newb)

      Hello all.  I am really new to python but have been learning.  This is my first post and hopefully someone will be able to help me out.  I have a .dbf that contains a huge list (59000 records) of geologic units and their corresponding quadrangles.  Each geologic unit can be found in multiple quads too.  I want to develop a program that asks a user to input what geologic unit their looking for and output the corresponding quadrangle(s).  What would be the best way for me to approach this problem?  Thanks for any input.
        • Re: Using Python to find DBF data (im a newb)
          Do you mean your DBF has a column with geologic unit and a column with quadrangle (name/number?) in one row?

          If so, to retrieve required data you can query table with something similar to this:
          SELECT DISTINCT 'Quadrangle'
          FROM YourDBF
          WHERE 'GeologicUnit' = "user provided name"

          If you realy have to do it with Python, you may need additional module like http://pypi.python.org/pypi/dbf/

          From your problem description, it appears that no spatial operation is required (actually it can't be as .dbf do not store spatial type).
          In this case maybe its better to import file into Access of Excell and create some form?