Skip to content

Simple io.Reader-compatible library which converts an XLSX sheet to CSV row by row

Notifications You must be signed in to change notification settings

mariaefi29/xlsx2csv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xlsx2csv

Simple io.Reader-compatible library which converts an XLSX sheet to CSV row by row

Example of usage

import (
    ...
)

func main() {
    file, err := os.Open(path)
    if err != nil {
        log.Fatalln(err)
    }
    defer file.Close()

    raw, err := ioutil.ReadAll(file)
    if err != nil {
        log.Fatalln(err)
    }

    reader, err := xlsx2csv.NewReader(raw, xlsx2csv.WithName("sheet"), ',')
    if err != nil {
        log.Fatalln(err)
    }

    rawCSV, err := ioutil.ReadAll(reader)
    if err != nil {
        log.Fatalln(err)
    }

    log.Println(string(rawCSV))
}

About

Simple io.Reader-compatible library which converts an XLSX sheet to CSV row by row

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages