Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Can ogr2ogr be used to append multiple DBF files? It works with SHP files, but I can't see how to do it with DBF files on their own. It ought to be possible, considering DBF is a subset of SHP.

share|improve this question

1 Answer 1

up vote 5 down vote accepted

Say you have three DBF files with the same field structure (schema), and you want to combine them into one all.dbf. From a system shell, use ogr2ogr with the -append flag:

$ ogr2ogr -append all.dbf a.dbf
$ ogr2ogr -append all.dbf b.dbf
$ ogr2ogr -append all.dbf c.dbf

These files can be either shapefiles or sole DBF files. It will work either way.

share|improve this answer
    
Alternatively, if you have dozens of files and all your shapefiles are in a single folder you can use the Vector->Data management Tools->Merge shapefiles to one tool in QGIS. Either, that or write a simple Python script to iterate Mike's solution above over the contents of a folder. –  MappaGnosis Jan 4 '13 at 10:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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