Skip to content

wolfmetr/go-dbf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-dbf

[Updated] A pure Go library for reading and writing dBase/xBase database files.

Fork from "code.google.com/p/go-dbf"

Updates

Removed dependency: "code.google.com/p/mahonia".

Usage

go get github.com/wolfmetr/go-dbf/godbf
import (
  "github.com/wolfmetr/go-dbf/godbf"
)

There's no real documentation as yet. Here is a very simple snippet of example 'load' code to get you going:

  type MyRow struct {
    ColumnId string
    ColumnValue string
  }

  dbfTable, err := godbf.NewFromFile("example_file.dbf", "cp866")

  resultList := make([]MyRow, dbfTable.NumberOfRecords())

  for i := 0; i < dbfTable.NumberOfRecords(); i++ {
    resultList[i] = new(MyRow)
    resultList[i].ColumnId, err = dbfTable.FieldValueByName(i, "COLUMN_ID")
    resultList[i].ColumnValue, err = dbfTable.FieldValueByName(i, "COLUMN_VALUE")
  }

About

[Updated] A pure Go library for reading and writing dBase/xBase database files.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages