Categorygithub.com/gofast-pkg/csv
modulepackage
0.0.2
Repository: https://github.com/gofast-pkg/csv.git
Documentation: pkg.go.dev

# README

CSV

Static Badge Build Go Reference codecov Release Go Report Card codebeat badge FOSSA Status License

Package CSV is a package to parse a full csv reader inside a slice structure. Allow to configure a decoder to transform directly csv entries into csv structure.

I had this specific need because i would to parse many csv files for differents type structure.

This package allow to configure dynamicly the structure builder to parse each entries files.

If you need an easy parser to decode csv file basicly, prefer use the csvutil package

Install

$> go get github.com/gofast-pkg/csv@latest

Usage

import github.com/gofast-pkg/csv

func main() {
  reader, err := os.Open(filePath)
  if err != nil {
    panic(err)
  }
  defer reader.Close()

  csvReader, err := csv.New(reader, ';')
  if err != nil {
    panic(err)
  }
}

Examples are provided on the go doc reference

Contributing

 :grey_exclamation:  Use issues for everything

Read more informations with the CONTRIBUTING_GUIDE

For all changes, please update the CHANGELOG.txt file by replacing the existant content.

Thank you  :pray:  :+1: 

Made with contrib.rocks.

Licence

MIT

# Functions

New create a new CSV reader from io.Reader.
NewDecoder returns a new decoder with the configuration passed as parameter.
NewWarning return a new warning For read a warning it's possible to iterate over it like a map.

# Constants

ExtensionFile for the csv file type.

# Variables

error for the csv parser.
error for the csv parser.
error for the csv parser.
error for the csv parser.
error for the csv parser.
error for the csv parser.
error for the csv parser.
error for the csv parser.
error for the csv parser.

# Structs

ConfigDecoder is the struct that contains the configuration to create a new decoder.

# Interfaces

CSV interface for new csv reader.
Decoder is the interface that wraps the basic methods to decode a csv file with a specific process for each line of the file.

# Type aliases

Warning collect relevants informations about the process on the csv file.