utils

package
v0.0.0-...-5735d38 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2020 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Some additional utilities that are useful when processing CSV headers and data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CToGoString

func CToGoString(c []byte) string

func ColumnReorder

func ColumnReorder(filePath string, columns []int, delimiter string)

ColumnReorder is to reorder the CSV columns

func DetectCsvDelimiter

func DetectCsvDelimiter(filePath string) string

DetectCsvDelimiter - detect and get csv delimiter

func Equal

func Equal(a, b []string) bool

Equal :test whether the given two string slices are equal

func Find

func Find(a []string, x string) int

Find returns the smallest index i at which x == a[i], or -1 if there is no such index.

func GetColumnCount

func GetColumnCount(filePath string) int

GetColumnCount : return the CSV column count

func GetHeader

func GetHeader(filePath string) []string

GetHeader : return the CSV header

func HeaderPositionEqual

func HeaderPositionEqual(a, b []int) bool

HeaderPositionEqual :test whether the given two string slices are equal

func IsSpace

func IsSpace(b byte) bool

Test for space character

func MaxInt

func MaxInt(a, b int) int

shortcut functions. hopefully will be inlined by compiler

func MinInt

func MinInt(a, b int) int

shortcut functions. hopefully will be inlined by compiler

func RandShuffle

func RandShuffle(input []int)

RandShuffle to shuffle the given slices of numbers

func TimeTrack

func TimeTrack(start time.Time, name string)

func ToLowerByte

func ToLowerByte(b byte) byte

convert byte to lower case

Types

This section is empty.

Jump to

Keyboard shortcuts

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