GithubHelp home page GithubHelp logo

xls's Introduction

xls

GoDoc

Pure Golang xls library writen by MinkTech(chinese).

Thanks for contributions from Tamás Gulácsi.

English User please mailto Liu Ming

This is a xls library writen in pure Golang. Almostly it is translated from the libxls library in c.

It has just the reading function without the format.

Basic Usage

  • Use Open function for open file
  • Use OpenReader function for open xls from a reader

These methods will open a workbook object for reading, like

func (w *WorkBook) ReadAllCells() (res [][]string) {
	for _, sheet := range w.Sheets {
		w.PrepareSheet(sheet)
		if sheet.MaxRow != 0 {
			temp := make([][]string, sheet.MaxRow+1)
			for k, row := range sheet.Rows {
				data := make([]string, 0)
				if len(row.Cols) > 0 {
					for _, col := range row.Cols {
						if uint16(len(data)) <= col.LastCol() {
							data = append(data, make([]string, col.LastCol()-uint16(len(data))+1)...)
						}
						str := col.String(w)
						for i := uint16(0); i < col.LastCol()-col.FirstCol()+1; i++ {
							data[col.FirstCol()+i] = str[i]
						}
					}
					temp[k] = data
				}
			}
			res = append(res, temp...)
		}
	}
	return
}

xls's People

Contributors

extrame avatar sstask avatar lucasbarross1 avatar tgulacsi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.