go-dbf

module
v0.0.0-...-4edd95f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 26, 2015 License: Apache-2.0

README

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")
  }

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL