sods

package module
v0.0.0-...-1993986 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2018 License: GPL-3.0 Imports: 7 Imported by: 0

README

sods

About

A simple parser for ODS tables

Installation

go get -u github.com/ssolov/sods

Example

Read and print all cell from ODS table to stdout

package main

import (
	"github.com/ssolov/sods"
)

func main() {
	ods, err := sods.Read("filename.ods")
	if err != nil {
		panic(err)
	}

	for _, sh := range ods.Sheets {
		fmt.Println("Table name: " + sh.Name)
		for _, row := range sh.Rows {
			for _, cell := range row {
				fmt.Print(cell)
			}
			fmt.Println()
		}
	}
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cell

type Cell string

Cell is a cell of the ods table

type File

type File struct {
	Sheets []Sheet
}

File is a holder for the ods sheets

func ParseContent

func ParseContent(content []byte) (*File, error)

ParseContent function will parse the content of content.xml

func Read

func Read(odsFileName string) (*File, error)

Read function opens and reads the content of ods file

type Row

type Row []Cell

Row is a row with cells of the ods table

type Sheet

type Sheet struct {
	Name string
	Rows []Row
}

Sheet is the ods sheet. Wich contains the rows.

Jump to

Keyboard shortcuts

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