To prepare for conversion, you will need to create a TXT file for each DBF file you have. To do this you can use a spreadsheet program such as Excel.
1) Open one of the DBF files, such as PROV.DBF, using the spreadsheet program. The first row in the spreadsheet will contain column headings. Each of the other rows represents information for a polygon in the corresponding SHP file.
2) Modify the spreadsheet by so that the columns contain the following information:
- Column 1: Text name of the geographic area
- Column 2: Province code
- Column 3: District code (if district level or below)
- Column 4: Village code (if village level or below)
- . . .
The first row should contain:
- Column 1: Name of the map (e.g. the country name)
- Column 2: Name of the 1st level (e.g. "Province" or "State")
- Column 3: Name of the 2nd level (e.g. "District" or "County")
- Column 4: Name of the 3rd level (e.g. "Village")
- . . .
This can be done most easily by deleting unwanted columns from the existing spreadsheet and rearranging the columns with names and codes in the desired order. DO NOT INSERT, DELETE, OR SORT THE ROWS. The order of the rows is critical in matching up correctly with the SHP and SHX files. The order names in the resulting maps will be in code order.
For the province level, the spreadsheet should look something like:
. . .
For the district level, the spreadsheet should look something like:
Popstan Province District
Dongo 1 1
Copal 1 2
Dari 1 3
Eris 1 4
. . .
Baja 2 1
Bassac 2 2
Chile 2 3
3) Use File/Save As to save the spreadsheet as a Text (Tab delimited) (*.txt) file. Save the file as tab delimited will allow you to easily bring it back into your speadsheet program to make any changes that may be necessary.