cmd

package module
v0.0.0-...-67e67be Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2020 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EXCEL_CELL_CHAR_LIMIT = 32767
	NUMBERS_ROW_LIMIT     = 65535
)
View Source
const (
	BOM_RUNE      = '\uFEFF'
	BOM_STRING    = "\uFEFF"
	NUM_BOM_BYTES = 3
)

Variables

View Source
var (
	// GIT_HASH is set during the build process using the -ldflags option.
	GIT_HASH string
	// VERSION is set during the build process using the -ldflags option.
	VERSION string
	// DEBUG is set by the common --debug flag
	DEBUG bool
)

Functions

func AddColumn

func AddColumn(inputCsv *InputCsv, outputCsvWriter OutputCsvWriter, tmpl *template.Template, name string, prepend bool)

func AutoIncrement

func AutoIncrement(inputCsv *InputCsv, outputCsvWriter OutputCsvWriter, name string, seed int, prepend bool)

func Behead

func Behead(inputCsv *InputCsv, outputCsvWriter OutputCsvWriter, numHeaders int)

func Cap

func Cap(inputCsv *InputCsv, outputCsvWriter OutputCsvWriter, names []string, truncateNames bool, defaultName string)

func ChangeDelimiter

func ChangeDelimiter(inputCsv *InputCsv, inputDelimiter, outputDelimiter string)

func ColumnTypeToSqliteType

func ColumnTypeToSqliteType(columnType ColumnType) string

func ColumnTypeToString

func ColumnTypeToString(columnType ColumnType) string

func ConvertXlsxFull

func ConvertXlsxFull(filename, dirname string)

func ConvertXlsxSheet

func ConvertXlsxSheet(filename, sheetName string)

func ConvertXlsxSheetToDirectory

func ConvertXlsxSheetToDirectory(dirname string, sheet *xlsx.Sheet)

func DescribeCsv

func DescribeCsv(inputCsv *InputCsv)

func ExcludeColumns

func ExcludeColumns(inputCsv *InputCsv, outputCsvWriter OutputCsvWriter, columns []string)

func ExitWithError

func ExitWithError(err error)

func FilterMatchFunc

func FilterMatchFunc(inputCsv *InputCsv, outputCsvWriter OutputCsvWriter, columns []string, exclude bool, matchFunc func(string) bool)

func GetArrayFromCsvString

func GetArrayFromCsvString(s string) []string

func GetBaseFilenameWithoutExtension

func GetBaseFilenameWithoutExtension(filename string) string

func GetDimensions

func GetDimensions(inputCsv *InputCsv, asCsv bool)

func GetFirstIndexOfString

func GetFirstIndexOfString(haystack []string, needle string) int

GetFirstIndexOfString gets the index of the first occurrence of a string in a string slice.

func GetIndexForColumn

func GetIndexForColumn(headers []string, column string) int

GetIndexForColumn finds the single index of a header given a column specification Note that this method assumes that only one index is requested so it has slightly different logic from GetIndicesForColumn.

func GetIndexForColumnOrPanic

func GetIndexForColumnOrPanic(headers []string, column string) int

GetIndexForColumnOrPanic is a simple wrapper around GetIndexForColumn that will simply panic if GetIndexForColumn returns -1.

func GetIndicesForColumn

func GetIndicesForColumn(headers []string, column string) (indices []int, err error)

GetIndicesForColumn translates a string representing a column requested into a slice of the indices of the matching column.

func GetIndicesForColumns

func GetIndicesForColumns(headers []string, columns []string) (indices []int, err error)

GetIndicesForColumns translates a slice of strings representing the columns requested into a slice of the indices of the matching columns.

func GetIndicesForColumnsOrPanic

func GetIndicesForColumnsOrPanic(headers []string, columns []string) (indices []int)

GetIndicesForColumnsOrPanic is a simple wrapper around GetIndicesForColumns that will simply panic if GetIndicesForColumns returns an error.

func GetIndicesOfString

func GetIndicesOfString(haystack []string, needle string) (indices []int)

GetIndicesOfString returns a slice of the indices at which the passed in string occurs in the input slice.

func GetNcol

func GetNcol(inputCsv *InputCsv)

func GetNrow

func GetNrow(inputCsv *InputCsv)

func GetStringForColumnIndex

func GetStringForColumnIndex(index int) string

func GetStringForRowIndex

func GetStringForRowIndex(index int) string

func HeadFromBottom

func HeadFromBottom(inputCsv *InputCsv, outputCsvWriter OutputCsvWriter, numRows int)

func HeadFromTop

func HeadFromTop(inputCsv *InputCsv, outputCsvWriter OutputCsvWriter, numRows int)

func InnerJoin

func InnerJoin(leftInputCsv, rightInputCsv *InputCsv, leftColname, rightColname string)

func IsBooleanType

func IsBooleanType(elem string) bool

func IsDateType

func IsDateType(elem string) bool

func IsDatetimeType

func IsDatetimeType(elem string) bool

func IsFloatType

func IsFloatType(elem string) bool

func IsIntType

func IsIntType(elem string) bool

func IsNullType

func IsNullType(elem string) bool

func LeftJoin

func LeftJoin(leftInputCsv, rightInputCsv *InputCsv, leftColname, rightColname string)

func ListXlxsSheets

func ListXlxsSheets(filename string)

func Main

func Main()

func MatchesSubcommand

func MatchesSubcommand(sub Subcommand, name string) bool

func OuterJoin

func OuterJoin(leftInputCsv, rightInputCsv *InputCsv, leftColname, rightColname string)

func ParseDate

func ParseDate(elem string) (time.Time, error)

func ParseDateOrPanic

func ParseDateOrPanic(elem string) time.Time

func ParseDatetime

func ParseDatetime(elem string) (time.Time, error)

func ParseDatetimeOrPanic

func ParseDatetimeOrPanic(elem string) time.Time

func ParseFloat64

func ParseFloat64(strVal string) (float64, error)

func ParseFloat64OrPanic

func ParseFloat64OrPanic(strVal string) float64

func ParseInt64

func ParseInt64(strVal string) (int64, error)

func ParseInt64OrPanic

func ParseInt64OrPanic(strVal string) int64

func PopulateSqlTable

func PopulateSqlTable(db *sql.DB, inputCsv *InputCsv)

func PrintCleanCheck

func PrintCleanCheck(rowIndex, columnIndex int, message string)

func RegisterSubcommand

func RegisterSubcommand(sub Subcommand)

func RenameColumns

func RenameColumns(inputCsv *InputCsv, outputCsvWriter OutputCsvWriter, columns, names []string)

func ReplaceWithFunc

func ReplaceWithFunc(inputCsv *InputCsv, outputCsvWriter OutputCsvWriter, columns []string, replaceFunc func(string) string)

func RightJoin

func RightJoin(leftInputCsv, rightInputCsv *InputCsv, leftColname, rightColname string)

func Sample

func Sample(inputCsv *InputCsv, numRows int, replace bool, seed int)

func SelectColumns

func SelectColumns(inputCsv *InputCsv, outputCsvWriter OutputCsvWriter, columns []string)

func ShowHeaders

func ShowHeaders(inputCsv *InputCsv, asCsv bool)

func Split

func Split(inputCsv *InputCsv, maxRows int, filenameBase string)

func StackFiles

func StackFiles(inputCsvs []*InputCsv, groupName string, groups []string)

func Stats

func Stats(inputCsv *InputCsv)

func TailFromBottom

func TailFromBottom(inputCsv *InputCsv, outputCsvWriter OutputCsvWriter, numRows int)

func TailFromTop

func TailFromTop(inputCsv *InputCsv, outputCsvWriter OutputCsvWriter, numRows int)

func Tsv

func Tsv(inputCsv *InputCsv)

func UniqueifySorted

func UniqueifySorted(inputCsv *InputCsv, outputCsvWriter OutputCsvWriter, columns []string)

func UniqueifySortedWithCount

func UniqueifySortedWithCount(inputCsv *InputCsv, outputCsvWriter OutputCsvWriter, columns []string)

func UniqueifyUnsorted

func UniqueifyUnsorted(inputCsv *InputCsv, outputCsvWriter OutputCsvWriter, columns []string)

func UniqueifyUnsortedWithCount

func UniqueifyUnsortedWithCount(inputCsv *InputCsv, outputCsvWriter OutputCsvWriter, columns []string)

func View

func View(inputCsv *InputCsv, maxWidth, maxLines, maxRows int)

func WriteSheetToOutputCsv

func WriteSheetToOutputCsv(sheet *xlsx.Sheet, outputCsv *OutputCsv)

func ZipFiles

func ZipFiles(inputCsvs []*InputCsv)

Types

type AddSubcommand

type AddSubcommand struct {
	// contains filtered or unexported fields
}

func (*AddSubcommand) Aliases

func (sub *AddSubcommand) Aliases() []string

func (*AddSubcommand) Description

func (sub *AddSubcommand) Description() string

func (*AddSubcommand) Name

func (sub *AddSubcommand) Name() string

func (*AddSubcommand) Run

func (sub *AddSubcommand) Run(args []string)

func (*AddSubcommand) RunAdd

func (sub *AddSubcommand) RunAdd(inputCsv *InputCsv, outputCsvWriter OutputCsvWriter)

func (*AddSubcommand) SetFlags

func (sub *AddSubcommand) SetFlags(fs *flag.FlagSet)

type AutoincrementSubcommand

type AutoincrementSubcommand struct {
	// contains filtered or unexported fields
}

func (*AutoincrementSubcommand) Aliases

func (sub *AutoincrementSubcommand) Aliases() []string

func (*AutoincrementSubcommand) Description

func (sub *AutoincrementSubcommand) Description() string

func (*AutoincrementSubcommand) Name

func (sub *AutoincrementSubcommand) Name() string

func (*AutoincrementSubcommand) Run

func (sub *AutoincrementSubcommand) Run(args []string)

func (*AutoincrementSubcommand) RunAutoincrement

func (sub *AutoincrementSubcommand) RunAutoincrement(inputCsv *InputCsv, outputCsvWriter OutputCsvWriter)

func (*AutoincrementSubcommand) SetFlags

func (sub *AutoincrementSubcommand) SetFlags(fs *flag.FlagSet)

type BeheadSubcommand

type BeheadSubcommand struct {
	// contains filtered or unexported fields
}

func (*BeheadSubcommand) Aliases

func (sub *BeheadSubcommand) Aliases() []string

func (*BeheadSubcommand) Description

func (sub *BeheadSubcommand) Description() string

func (*BeheadSubcommand) Name

func (sub *BeheadSubcommand) Name() string

func (*BeheadSubcommand) Run

func (sub *BeheadSubcommand) Run(args []string)

func (*BeheadSubcommand) RunBehead

func (sub *BeheadSubcommand) RunBehead(inputCsv *InputCsv, outputCsvWriter OutputCsvWriter)

func (*BeheadSubcommand) SetFlags

func (sub *BeheadSubcommand) SetFlags(fs *flag.FlagSet)

type CapSubcommand

type CapSubcommand struct {
	// contains filtered or unexported fields
}

func (*CapSubcommand) Aliases

func (sub *CapSubcommand) Aliases() []string

func (*CapSubcommand) Description

func (sub *CapSubcommand) Description() string

func (*CapSubcommand) Name

func (sub *CapSubcommand) Name() string

func (*CapSubcommand) Run

func (sub *CapSubcommand) Run(args []string)

func (*CapSubcommand) RunCap

func (sub *CapSubcommand) RunCap(inputCsv *InputCsv, outputCsvWriter OutputCsvWriter)

func (*CapSubcommand) SetFlags

func (sub *CapSubcommand) SetFlags(fs *flag.FlagSet)

type CleanSubcommand

type CleanSubcommand struct {
	// contains filtered or unexported fields
}

func (*CleanSubcommand) Aliases

func (sub *CleanSubcommand) Aliases() []string

func (*CleanSubcommand) Clean

func (sub *CleanSubcommand) Clean(inputCsv *InputCsv)

func (*CleanSubcommand) Description

func (sub *CleanSubcommand) Description() string

func (*CleanSubcommand) Name

func (sub *CleanSubcommand) Name() string

func (*CleanSubcommand) Run

func (sub *CleanSubcommand) Run(args []string)

func (*CleanSubcommand) SetFlags

func (sub *CleanSubcommand) SetFlags(fs *flag.FlagSet)

type ColumnType

type ColumnType int
const (
	NULL_TYPE ColumnType = iota
	INT_TYPE
	FLOAT_TYPE
	BOOLEAN_TYPE
	DATETIME_TYPE
	DATE_TYPE
	STRING_TYPE
)

NOTE: Order matters here. Ordered by strictness descending

func InferTypeWithHint

func InferTypeWithHint(elem string, hint ColumnType) ColumnType

type DateColumnStats

type DateColumnStats struct {
	// contains filtered or unexported fields
}

func NewDateColumnsStats

func NewDateColumnsStats(dateArray []time.Time) *DateColumnStats

func (*DateColumnStats) CalculateAllStats

func (dcs *DateColumnStats) CalculateAllStats()

func (*DateColumnStats) CalculateMax

func (dcs *DateColumnStats) CalculateMax()

func (*DateColumnStats) CalculateMin

func (dcs *DateColumnStats) CalculateMin()

func (*DateColumnStats) CalculateValueCounts

func (dcs *DateColumnStats) CalculateValueCounts()

type DelimiterSubcommand

type DelimiterSubcommand struct {
	// contains filtered or unexported fields
}

func (*DelimiterSubcommand) Aliases

func (sub *DelimiterSubcommand) Aliases() []string

func (*DelimiterSubcommand) Description

func (sub *DelimiterSubcommand) Description() string

func (*DelimiterSubcommand) Name

func (sub *DelimiterSubcommand) Name() string

func (*DelimiterSubcommand) Run

func (sub *DelimiterSubcommand) Run(args []string)

func (*DelimiterSubcommand) SetFlags

func (sub *DelimiterSubcommand) SetFlags(fs *flag.FlagSet)

type DescribeSubcommand

type DescribeSubcommand struct{}

func (*DescribeSubcommand) Aliases

func (sub *DescribeSubcommand) Aliases() []string

func (*DescribeSubcommand) Description

func (sub *DescribeSubcommand) Description() string

func (*DescribeSubcommand) Name

func (sub *DescribeSubcommand) Name() string

func (*DescribeSubcommand) Run

func (sub *DescribeSubcommand) Run(args []string)

func (*DescribeSubcommand) SetFlags

func (sub *DescribeSubcommand) SetFlags(fs *flag.FlagSet)

type DimensionsSubcommand

type DimensionsSubcommand struct {
	// contains filtered or unexported fields
}

func (*DimensionsSubcommand) Aliases

func (sub *DimensionsSubcommand) Aliases() []string

func (*DimensionsSubcommand) Description

func (sub *DimensionsSubcommand) Description() string

func (*DimensionsSubcommand) Name

func (sub *DimensionsSubcommand) Name() string

func (*DimensionsSubcommand) Run

func (sub *DimensionsSubcommand) Run(args []string)

func (*DimensionsSubcommand) SetFlags

func (sub *DimensionsSubcommand) SetFlags(fs *flag.FlagSet)

type FilterSubcommand

type FilterSubcommand struct {
	// contains filtered or unexported fields
}

func (*FilterSubcommand) Aliases

func (sub *FilterSubcommand) Aliases() []string

func (*FilterSubcommand) Description

func (sub *FilterSubcommand) Description() string

func (*FilterSubcommand) Name

func (sub *FilterSubcommand) Name() string

func (*FilterSubcommand) Run

func (sub *FilterSubcommand) Run(args []string)

func (*FilterSubcommand) RunFilter

func (sub *FilterSubcommand) RunFilter(inputCsv *InputCsv, outputCsvWriter OutputCsvWriter)

func (*FilterSubcommand) SetFlags

func (sub *FilterSubcommand) SetFlags(fs *flag.FlagSet)

type FloatColumnStats

type FloatColumnStats struct {
	// contains filtered or unexported fields
}

func NewFloatColumnsStats

func NewFloatColumnsStats(floatArray []float64) *FloatColumnStats

func (*FloatColumnStats) CalculateAllStats

func (fcs *FloatColumnStats) CalculateAllStats()

func (*FloatColumnStats) CalculateMax

func (fcs *FloatColumnStats) CalculateMax()

func (*FloatColumnStats) CalculateMean

func (fcs *FloatColumnStats) CalculateMean()

func (*FloatColumnStats) CalculateMedian

func (fcs *FloatColumnStats) CalculateMedian()

func (*FloatColumnStats) CalculateMin

func (fcs *FloatColumnStats) CalculateMin()

func (*FloatColumnStats) CalculateStdDev

func (fcs *FloatColumnStats) CalculateStdDev()

func (*FloatColumnStats) CalculateSum

func (fcs *FloatColumnStats) CalculateSum()

func (*FloatColumnStats) CalculateValueCounts

func (fcs *FloatColumnStats) CalculateValueCounts()

type FloatValueCount

type FloatValueCount struct {
	// contains filtered or unexported fields
}

type FloatValueCountByCount

type FloatValueCountByCount []FloatValueCount

func (FloatValueCountByCount) Len

func (a FloatValueCountByCount) Len() int

func (FloatValueCountByCount) Less

func (a FloatValueCountByCount) Less(i, j int) bool

func (FloatValueCountByCount) Swap

func (a FloatValueCountByCount) Swap(i, j int)

type HeadSubcommand

type HeadSubcommand struct {
	// contains filtered or unexported fields
}

func (*HeadSubcommand) Aliases

func (sub *HeadSubcommand) Aliases() []string

func (*HeadSubcommand) Description

func (sub *HeadSubcommand) Description() string

func (*HeadSubcommand) Name

func (sub *HeadSubcommand) Name() string

func (*HeadSubcommand) Run

func (sub *HeadSubcommand) Run(args []string)

func (*HeadSubcommand) RunHead

func (sub *HeadSubcommand) RunHead(inputCsv *InputCsv, outputCsvWriter OutputCsvWriter)

func (*HeadSubcommand) SetFlags

func (sub *HeadSubcommand) SetFlags(fs *flag.FlagSet)

type HeadersSubcommand

type HeadersSubcommand struct {
	// contains filtered or unexported fields
}

func (*HeadersSubcommand) Aliases

func (sub *HeadersSubcommand) Aliases() []string

func (*HeadersSubcommand) Description

func (sub *HeadersSubcommand) Description() string

func (*HeadersSubcommand) Name

func (sub *HeadersSubcommand) Name() string

func (*HeadersSubcommand) Run

func (sub *HeadersSubcommand) Run(args []string)

func (*HeadersSubcommand) SetFlags

func (sub *HeadersSubcommand) SetFlags(fs *flag.FlagSet)

type InMemoryCsv

type InMemoryCsv struct {
	// contains filtered or unexported fields
}

func NewInMemoryCsvFromInputCsv

func NewInMemoryCsvFromInputCsv(inputCsv *InputCsv) *InMemoryCsv

func (*InMemoryCsv) CountNullsInColumn

func (imc *InMemoryCsv) CountNullsInColumn(columnIndex int) int

func (*InMemoryCsv) GetRowIndicesMatchingIndexedColumn

func (imc *InMemoryCsv) GetRowIndicesMatchingIndexedColumn(value string) []int

func (*InMemoryCsv) GetRowsMatchingIndexedColumn

func (imc *InMemoryCsv) GetRowsMatchingIndexedColumn(value string) [][]string

func (*InMemoryCsv) Index

func (imc *InMemoryCsv) Index(columnIndex int)

func (*InMemoryCsv) InferType

func (imc *InMemoryCsv) InferType(columnIndex int) ColumnType

func (*InMemoryCsv) NumColumns

func (imc *InMemoryCsv) NumColumns() int

func (*InMemoryCsv) NumRows

func (imc *InMemoryCsv) NumRows() int

func (*InMemoryCsv) PrintColumnNumberNulls

func (imc *InMemoryCsv) PrintColumnNumberNulls(columnIndex int)

func (*InMemoryCsv) PrintStats

func (imc *InMemoryCsv) PrintStats()

func (*InMemoryCsv) PrintStatsForColumn

func (imc *InMemoryCsv) PrintStatsForColumn(columnIndex int)

func (*InMemoryCsv) PrintStatsForColumnAsBoolean

func (imc *InMemoryCsv) PrintStatsForColumnAsBoolean(columnIndex int)

func (*InMemoryCsv) PrintStatsForColumnAsDate

func (imc *InMemoryCsv) PrintStatsForColumnAsDate(columnIndex int)

func (*InMemoryCsv) PrintStatsForColumnAsFloat

func (imc *InMemoryCsv) PrintStatsForColumnAsFloat(columnIndex int)

func (*InMemoryCsv) PrintStatsForColumnAsInt

func (imc *InMemoryCsv) PrintStatsForColumnAsInt(columnIndex int)

func (*InMemoryCsv) PrintStatsForColumnAsString

func (imc *InMemoryCsv) PrintStatsForColumnAsString(columnIndex int)

func (*InMemoryCsv) SampleRowIndices

func (imc *InMemoryCsv) SampleRowIndices(numRows int, replace bool, seed int) []int

func (*InMemoryCsv) SampleRowIndicesWithReplacement

func (imc *InMemoryCsv) SampleRowIndicesWithReplacement(numRows, seed int) []int

func (*InMemoryCsv) SampleRowIndicesWithoutReplacement

func (imc *InMemoryCsv) SampleRowIndicesWithoutReplacement(numRows, seed int) []int

func (*InMemoryCsv) SortRows

func (imc *InMemoryCsv) SortRows(columnIndices []int, columnTypes []ColumnType, reverse bool)

type InputCsv

type InputCsv struct {
	// contains filtered or unexported fields
}

func GetInputCsvs

func GetInputCsvs(filenames []string, numInputCsvs int) (csvs []*InputCsv, err error)

func GetInputCsvsOrPanic

func GetInputCsvsOrPanic(filenames []string, numInputCsvs int) (csvs []*InputCsv)

func NewInputCsv

func NewInputCsv(filename string) (ic *InputCsv, err error)

func (*InputCsv) Close

func (ic *InputCsv) Close() error

func (*InputCsv) Filename

func (ic *InputCsv) Filename() string

func (*InputCsv) Name

func (ic *InputCsv) Name() string

func (*InputCsv) Read

func (ic *InputCsv) Read() (row []string, err error)

func (*InputCsv) ReadAll

func (ic *InputCsv) ReadAll() (rows [][]string, err error)

func (*InputCsv) Reader

func (ic *InputCsv) Reader() *csv.Reader

func (*InputCsv) SetDelimiter

func (ic *InputCsv) SetDelimiter(delimiter rune)

func (*InputCsv) SetFieldsPerRecord

func (ic *InputCsv) SetFieldsPerRecord(fieldsPerRecord int)

func (*InputCsv) SetLazyQuotes

func (ic *InputCsv) SetLazyQuotes(lazyQuotes bool)

type Int64Array

type Int64Array []int64

func (Int64Array) Len

func (a Int64Array) Len() int

func (Int64Array) Less

func (a Int64Array) Less(i, j int) bool

func (Int64Array) Swap

func (a Int64Array) Swap(i, j int)

type IntColumnStats

type IntColumnStats struct {
	// contains filtered or unexported fields
}

func NewIntColumnsStats

func NewIntColumnsStats(intArray []int64) *IntColumnStats

func (*IntColumnStats) CalculateAllStats

func (ics *IntColumnStats) CalculateAllStats()

func (*IntColumnStats) CalculateMax

func (ics *IntColumnStats) CalculateMax()

func (*IntColumnStats) CalculateMean

func (ics *IntColumnStats) CalculateMean()

func (*IntColumnStats) CalculateMedian

func (ics *IntColumnStats) CalculateMedian()

func (*IntColumnStats) CalculateMin

func (ics *IntColumnStats) CalculateMin()

func (*IntColumnStats) CalculateStdDev

func (ics *IntColumnStats) CalculateStdDev()

func (*IntColumnStats) CalculateSum

func (ics *IntColumnStats) CalculateSum()

func (*IntColumnStats) CalculateValueCounts

func (ics *IntColumnStats) CalculateValueCounts()

type IntValueCount

type IntValueCount struct {
	// contains filtered or unexported fields
}

type IntValueCountByCount

type IntValueCountByCount []IntValueCount

func (IntValueCountByCount) Len

func (a IntValueCountByCount) Len() int

func (IntValueCountByCount) Less

func (a IntValueCountByCount) Less(i, j int) bool

func (IntValueCountByCount) Swap

func (a IntValueCountByCount) Swap(i, j int)

type JoinSubcommand

type JoinSubcommand struct {
	// contains filtered or unexported fields
}

func (*JoinSubcommand) Aliases

func (sub *JoinSubcommand) Aliases() []string

func (*JoinSubcommand) Description

func (sub *JoinSubcommand) Description() string

func (*JoinSubcommand) Name

func (sub *JoinSubcommand) Name() string

func (*JoinSubcommand) Run

func (sub *JoinSubcommand) Run(args []string)

func (*JoinSubcommand) SetFlags

func (sub *JoinSubcommand) SetFlags(fs *flag.FlagSet)

type NcolSubcommand

type NcolSubcommand struct {
}

func (*NcolSubcommand) Aliases

func (sub *NcolSubcommand) Aliases() []string

func (*NcolSubcommand) Description

func (sub *NcolSubcommand) Description() string

func (*NcolSubcommand) Name

func (sub *NcolSubcommand) Name() string

func (*NcolSubcommand) Run

func (sub *NcolSubcommand) Run(args []string)

func (*NcolSubcommand) SetFlags

func (sub *NcolSubcommand) SetFlags(fs *flag.FlagSet)

type NrowSubcommand

type NrowSubcommand struct {
}

func (*NrowSubcommand) Aliases

func (sub *NrowSubcommand) Aliases() []string

func (*NrowSubcommand) Description

func (sub *NrowSubcommand) Description() string

func (*NrowSubcommand) Name

func (sub *NrowSubcommand) Name() string

func (*NrowSubcommand) Run

func (sub *NrowSubcommand) Run(args []string)

func (*NrowSubcommand) SetFlags

func (sub *NrowSubcommand) SetFlags(fs *flag.FlagSet)

type OutputCsv

type OutputCsv struct {
	// contains filtered or unexported fields
}

func NewFileOutputCsvFromInputCsv

func NewFileOutputCsvFromInputCsv(inputCsv *InputCsv, file *os.File) (oc *OutputCsv)

func NewOutputCsv

func NewOutputCsv() (oc *OutputCsv)

func NewOutputCsvFromFile

func NewOutputCsvFromFile(file *os.File) (oc *OutputCsv)

func NewOutputCsvFromInputCsv

func NewOutputCsvFromInputCsv(inputCsv *InputCsv) (oc *OutputCsv)

func NewOutputCsvFromInputCsvs

func NewOutputCsvFromInputCsvs(inputCsvs []*InputCsv) (oc *OutputCsv)

func NewOutputCsvFromInputCsvsAndFile

func NewOutputCsvFromInputCsvsAndFile(inputCsvs []*InputCsv, file *os.File) (oc *OutputCsv)

func (*OutputCsv) SetDelimiter

func (oc *OutputCsv) SetDelimiter(delimiter rune)

func (*OutputCsv) Write

func (oc *OutputCsv) Write(row []string) error

type OutputCsvWriter

type OutputCsvWriter interface {
	Write(row []string) error
}

type RenameSubcommand

type RenameSubcommand struct {
	// contains filtered or unexported fields
}

func (*RenameSubcommand) Aliases

func (sub *RenameSubcommand) Aliases() []string

func (*RenameSubcommand) Description

func (sub *RenameSubcommand) Description() string

func (*RenameSubcommand) Name

func (sub *RenameSubcommand) Name() string

func (*RenameSubcommand) Run

func (sub *RenameSubcommand) Run(args []string)

func (*RenameSubcommand) RunRename

func (sub *RenameSubcommand) RunRename(inputCsv *InputCsv, outputCsvWriter OutputCsvWriter)

func (*RenameSubcommand) SetFlags

func (sub *RenameSubcommand) SetFlags(fs *flag.FlagSet)

type ReplaceSubcommand

type ReplaceSubcommand struct {
	// contains filtered or unexported fields
}

func (*ReplaceSubcommand) Aliases

func (sub *ReplaceSubcommand) Aliases() []string

func (*ReplaceSubcommand) Description

func (sub *ReplaceSubcommand) Description() string

func (*ReplaceSubcommand) Name

func (sub *ReplaceSubcommand) Name() string

func (*ReplaceSubcommand) Run

func (sub *ReplaceSubcommand) Run(args []string)

func (*ReplaceSubcommand) RunReplace

func (sub *ReplaceSubcommand) RunReplace(inputCsv *InputCsv, outputCsvWriter OutputCsvWriter)

func (*ReplaceSubcommand) SetFlags

func (sub *ReplaceSubcommand) SetFlags(fs *flag.FlagSet)

type RowSorter

type RowSorter struct {
	// contains filtered or unexported fields
}

func (*RowSorter) Len

func (rs *RowSorter) Len() int

func (*RowSorter) Less

func (rs *RowSorter) Less(i, j int) bool

func (*RowSorter) Swap

func (rs *RowSorter) Swap(i, j int)

type SampleSubcommand

type SampleSubcommand struct {
	// contains filtered or unexported fields
}

func (*SampleSubcommand) Aliases

func (sub *SampleSubcommand) Aliases() []string

func (*SampleSubcommand) Description

func (sub *SampleSubcommand) Description() string

func (*SampleSubcommand) Name

func (sub *SampleSubcommand) Name() string

func (*SampleSubcommand) Run

func (sub *SampleSubcommand) Run(args []string)

func (*SampleSubcommand) SetFlags

func (sub *SampleSubcommand) SetFlags(fs *flag.FlagSet)

type SelectSubcommand

type SelectSubcommand struct {
	// contains filtered or unexported fields
}

func (*SelectSubcommand) Aliases

func (sub *SelectSubcommand) Aliases() []string

func (*SelectSubcommand) Description

func (sub *SelectSubcommand) Description() string

func (*SelectSubcommand) Name

func (sub *SelectSubcommand) Name() string

func (*SelectSubcommand) Run

func (sub *SelectSubcommand) Run(args []string)

func (*SelectSubcommand) RunSelect

func (sub *SelectSubcommand) RunSelect(inputCsv *InputCsv, outputCsvWriter OutputCsvWriter)

func (*SelectSubcommand) SetFlags

func (sub *SelectSubcommand) SetFlags(fs *flag.FlagSet)

type SortRowsBy

type SortRowsBy func(r1, r2 *[]string) bool

Adapted from https://golang.org/pkg/sort/#example__sortKeys

func (SortRowsBy) Sort

func (by SortRowsBy) Sort(rows [][]string, reverse bool)

type SortSubcommand

type SortSubcommand struct {
	// contains filtered or unexported fields
}

func (*SortSubcommand) Aliases

func (sub *SortSubcommand) Aliases() []string

func (*SortSubcommand) Description

func (sub *SortSubcommand) Description() string

func (*SortSubcommand) Name

func (sub *SortSubcommand) Name() string

func (*SortSubcommand) Run

func (sub *SortSubcommand) Run(args []string)

func (*SortSubcommand) SetFlags

func (sub *SortSubcommand) SetFlags(fs *flag.FlagSet)

func (*SortSubcommand) SortCsv

func (sub *SortSubcommand) SortCsv(inputCsv *InputCsv, outputCsvWriter OutputCsvWriter)

type SplitSubcommand

type SplitSubcommand struct {
	// contains filtered or unexported fields
}

func (*SplitSubcommand) Aliases

func (sub *SplitSubcommand) Aliases() []string

func (*SplitSubcommand) Description

func (sub *SplitSubcommand) Description() string

func (*SplitSubcommand) Name

func (sub *SplitSubcommand) Name() string

func (*SplitSubcommand) Run

func (sub *SplitSubcommand) Run(args []string)

func (*SplitSubcommand) SetFlags

func (sub *SplitSubcommand) SetFlags(fs *flag.FlagSet)

type SqlSubcommand

type SqlSubcommand struct {
	// contains filtered or unexported fields
}

func (*SqlSubcommand) Aliases

func (sub *SqlSubcommand) Aliases() []string

func (*SqlSubcommand) Description

func (sub *SqlSubcommand) Description() string

func (*SqlSubcommand) Name

func (sub *SqlSubcommand) Name() string

func (*SqlSubcommand) Run

func (sub *SqlSubcommand) Run(args []string)

func (*SqlSubcommand) RunSql

func (sub *SqlSubcommand) RunSql(inputCsvs []*InputCsv, outputCsvWriter OutputCsvWriter)

func (*SqlSubcommand) SetFlags

func (sub *SqlSubcommand) SetFlags(fs *flag.FlagSet)

type StackSubcommand

type StackSubcommand struct {
	// contains filtered or unexported fields
}

func (*StackSubcommand) Aliases

func (sub *StackSubcommand) Aliases() []string

func (*StackSubcommand) Description

func (sub *StackSubcommand) Description() string

func (*StackSubcommand) Name

func (sub *StackSubcommand) Name() string

func (*StackSubcommand) Run

func (sub *StackSubcommand) Run(args []string)

func (*StackSubcommand) SetFlags

func (sub *StackSubcommand) SetFlags(fs *flag.FlagSet)

type StatsSubcommand

type StatsSubcommand struct{}

func (*StatsSubcommand) Aliases

func (sub *StatsSubcommand) Aliases() []string

func (*StatsSubcommand) Description

func (sub *StatsSubcommand) Description() string

func (*StatsSubcommand) Name

func (sub *StatsSubcommand) Name() string

func (*StatsSubcommand) Run

func (sub *StatsSubcommand) Run(args []string)

func (*StatsSubcommand) SetFlags

func (sub *StatsSubcommand) SetFlags(fs *flag.FlagSet)

type StringColumnStats

type StringColumnStats struct {
	// contains filtered or unexported fields
}

func NewStringColumnsStats

func NewStringColumnsStats(stringArray []string) *StringColumnStats

func (*StringColumnStats) CalculateAllStats

func (scs *StringColumnStats) CalculateAllStats()

func (*StringColumnStats) CalculateMaxLength

func (scs *StringColumnStats) CalculateMaxLength()

func (*StringColumnStats) CalculateValueCounts

func (scs *StringColumnStats) CalculateValueCounts()

type StringValueCount

type StringValueCount struct {
	// contains filtered or unexported fields
}

type StringValueCountByCount

type StringValueCountByCount []StringValueCount

func (StringValueCountByCount) Len

func (a StringValueCountByCount) Len() int

func (StringValueCountByCount) Less

func (a StringValueCountByCount) Less(i, j int) bool

func (StringValueCountByCount) Swap

func (a StringValueCountByCount) Swap(i, j int)

type Subcommand

type Subcommand interface {
	Name() string
	Aliases() []string
	Description() string
	SetFlags(*flag.FlagSet)
	Run([]string)
}

type TailSubcommand

type TailSubcommand struct {
	// contains filtered or unexported fields
}

func (*TailSubcommand) Aliases

func (sub *TailSubcommand) Aliases() []string

func (*TailSubcommand) Description

func (sub *TailSubcommand) Description() string

func (*TailSubcommand) Name

func (sub *TailSubcommand) Name() string

func (*TailSubcommand) Run

func (sub *TailSubcommand) Run(args []string)

func (*TailSubcommand) RunTail

func (sub *TailSubcommand) RunTail(inputCsv *InputCsv, outputCsvWriter OutputCsvWriter)

func (*TailSubcommand) SetFlags

func (sub *TailSubcommand) SetFlags(fs *flag.FlagSet)

type TransposeSubcommand

type TransposeSubcommand struct {
}

func (*TransposeSubcommand) Aliases

func (sub *TransposeSubcommand) Aliases() []string

func (*TransposeSubcommand) Description

func (sub *TransposeSubcommand) Description() string

func (*TransposeSubcommand) Name

func (sub *TransposeSubcommand) Name() string

func (*TransposeSubcommand) Run

func (sub *TransposeSubcommand) Run(args []string)

func (*TransposeSubcommand) RunTranspose

func (sub *TransposeSubcommand) RunTranspose(inputCsv *InputCsv, outputCsvWriter OutputCsvWriter)

func (*TransposeSubcommand) SetFlags

func (sub *TransposeSubcommand) SetFlags(fs *flag.FlagSet)

type TsvSubcommand

type TsvSubcommand struct{}

func (*TsvSubcommand) Aliases

func (sub *TsvSubcommand) Aliases() []string

func (*TsvSubcommand) Description

func (sub *TsvSubcommand) Description() string

func (*TsvSubcommand) Name

func (sub *TsvSubcommand) Name() string

func (*TsvSubcommand) Run

func (sub *TsvSubcommand) Run(args []string)

func (*TsvSubcommand) SetFlags

func (sub *TsvSubcommand) SetFlags(fs *flag.FlagSet)

type UniqueSubcommand

type UniqueSubcommand struct {
	// contains filtered or unexported fields
}

func (*UniqueSubcommand) Aliases

func (sub *UniqueSubcommand) Aliases() []string

func (*UniqueSubcommand) Description

func (sub *UniqueSubcommand) Description() string

func (*UniqueSubcommand) Name

func (sub *UniqueSubcommand) Name() string

func (*UniqueSubcommand) Run

func (sub *UniqueSubcommand) Run(args []string)

func (*UniqueSubcommand) RunUnique

func (sub *UniqueSubcommand) RunUnique(inputCsv *InputCsv, outputCsvWriter OutputCsvWriter)

func (*UniqueSubcommand) SetFlags

func (sub *UniqueSubcommand) SetFlags(fs *flag.FlagSet)

type ViewSubcommand

type ViewSubcommand struct {
	// contains filtered or unexported fields
}

func (*ViewSubcommand) Aliases

func (sub *ViewSubcommand) Aliases() []string

func (*ViewSubcommand) Description

func (sub *ViewSubcommand) Description() string

func (*ViewSubcommand) Name

func (sub *ViewSubcommand) Name() string

func (*ViewSubcommand) Run

func (sub *ViewSubcommand) Run(args []string)

func (*ViewSubcommand) SetFlags

func (sub *ViewSubcommand) SetFlags(fs *flag.FlagSet)

type XlsxSubcommand

type XlsxSubcommand struct {
	// contains filtered or unexported fields
}

func (*XlsxSubcommand) Aliases

func (sub *XlsxSubcommand) Aliases() []string

func (*XlsxSubcommand) Description

func (sub *XlsxSubcommand) Description() string

func (*XlsxSubcommand) Name

func (sub *XlsxSubcommand) Name() string

func (*XlsxSubcommand) Run

func (sub *XlsxSubcommand) Run(args []string)

func (*XlsxSubcommand) SetFlags

func (sub *XlsxSubcommand) SetFlags(fs *flag.FlagSet)

type ZipSubcommand

type ZipSubcommand struct {
}

func (*ZipSubcommand) Aliases

func (sub *ZipSubcommand) Aliases() []string

func (*ZipSubcommand) Description

func (sub *ZipSubcommand) Description() string

func (*ZipSubcommand) Name

func (sub *ZipSubcommand) Name() string

func (*ZipSubcommand) Run

func (sub *ZipSubcommand) Run(args []string)

func (*ZipSubcommand) SetFlags

func (sub *ZipSubcommand) SetFlags(fs *flag.FlagSet)

Jump to

Keyboard shortcuts

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