easycsv

package module
v0.0.0-...-3953b5f Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2024 License: MIT Imports: 4 Imported by: 0

README

easycsv

Package easycsv provides some utilities that simplify reading CSV data using the encoding/csv package.

Documentation

Overview

Package easycsv provides some utilities that simplify reading CSV data using the encoding/csv package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadColumns

func ReadColumns(reader io.Reader, columns []string) ([][]string, error)

ReadColumns reads specified CSV columns from reader and returns a slice of records. Returned rows contain values in the order provided in columns. The header row is not included in the returned result. If any of the column names cannot be found in the CSV header row, ReadColumns returns an error.

func ReadColumnsFunc

func ReadColumnsFunc(reader io.Reader, columns []string, f func([]string) error) error

ReadColumnsFunc reads specified CSV columns from reader and calls f for every record. Function f is called for every row with values in the order provided in columns. ReadColumnsFunc doesn't call f for the header row. If any of the column names cannot be found in the CSV header row, ReadColumnsFunc returns an error.

Types

This section is empty.

Jump to

Keyboard shortcuts

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