calcdata

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenFile

func OpenFile(path string) (*ods.Doc, error)

OpenFile returns Calc file instance.

Types

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

Reader is class of LibreOffice Calc data

func New

func New(doc *ods.Doc, sheetName string) (*Reader, error)

New function creates a new Reader instance.

Example
package main

import (
	"fmt"

	"github.com/goark/csvdata"
	"github.com/goark/csvdata/calcdata"
)

func main() {
	ods, err := calcdata.OpenFile("testdata/sample.ods")
	if err != nil {
		fmt.Println(err)
		return
	}
	r, err := calcdata.New(ods, "")
	if err != nil {
		fmt.Println(err)
		return
	}
	rc := csvdata.NewRows(r, true)
	defer rc.Close() //dummy

	if err := rc.Next(); err != nil {
		fmt.Println(err)
		return
	}
	fmt.Println(rc.Column("name"))
}
Output:

Mercury

func (*Reader) Close

func (r *Reader) Close() error

Close method is dummy.

func (*Reader) LazyQuotes added in v0.6.0

func (r *Reader) LazyQuotes() bool

LazyQuotes returns true.

func (*Reader) Read

func (r *Reader) Read() ([]string, error)

func (*Reader) TrimSpace added in v0.7.0

func (r *Reader) TrimSpace() bool

TrimSpace returns false.

Jump to

Keyboard shortcuts

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