Skip to content

tiptok/tab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

table data extractor for Go

Installation

go get github.com/tiptok/tab

Usage

Example read table from excel(xlsx、xls)、html-table,and write to a file

package main

import (
	"fmt"
	"os"
	"github.com/tiptok/tab"
)

func main() {
	filename := "testdata/test.xlsx"
	file, err := os.Open(filename)
	if err != nil {
		panic(err)
	}
	tabulator := tab.NewTabulator(tab.WithReadFrom(tab.XLSX))
	table, err := tabulator.Open(file)
	if err != nil {
		panic(err)
	}
	fmt.Println(table)
	
	err = tabulator.Write(tab.CSV, filename)
	if err != nil {
		panic(err)
	}
}

More example In example_test.go

Dependency

  • github.com/extrame/xls
  • github.com/xuri/excelize/v2
  • github.com/nfx/go-htmltable#page

About

table data extractor for Go

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages