5

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.

underdark
  • 84,148
  • 21
  • 231
  • 413
Uffe Kousgaard
  • 2,543
  • 15
  • 24

1 Answers1

7

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.

Mike T
  • 42,095
  • 10
  • 126
  • 187
  • 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 04 '13 at 10:39