Documentation ¶
Index ¶
- Constants
- Variables
- func ColIndexToLetters(colIndex uint32) string
- func ColNumberToLetters(colNumber uint32) string
- func CoordinateNumbersToSheetLocation(colNum, rowNum uint32) string
- func CoordinatesToSheetLocation(colIdx, rowIdx uint32) string
- func FormatDateAndFloats(val string, colIdx uint) (interface{}, error)
- func FormatMonthAndFloats(val string, colIdx uint) (interface{}, error)
- func FormatStringAndFloats(val string, colIdx uint) (interface{}, error)
- func FormatStringAndInts(val string, colIdx uint) (interface{}, error)
- func FormatStrings(val string, col uint) (interface{}, error)
- func FormatTimeAndFloats(val string, colIdx uint) (interface{}, error)
- func FormatTimeAndInts(val string, colIdx uint) (interface{}, error)
- func ReadCSVFileSingleColumnValuesString(filename, sep string, hasHeader, trimSpace bool, col uint, ...) ([]string, error)
- func ReadCSVFilesSingleColumnValuesString(files []string, sep string, hasHeader, trimSpace bool, col uint, ...) ([]string, error)
- func SimpleTable(table Table) string
- func StreamSimpleTable(qw422016 *qt422016.Writer, table Table)
- func ToDocuments(tbl *Table) []map[string]interface{}
- func ToHTML(tbl *Table, escapeHTML bool) string
- func WriteCSV(path string, t *Table) error
- func WriteCSVSimple(cols []string, records [][]string, filename string) error
- func WriteSimpleTable(qq422016 qtio422016.Writer, table Table)
- func WriteXLSX(path string, tables ...*Table) error
- func WriteXLSXInterface(filename string, sheetdatas ...SheetData) error
- type Column
- type ColumnSet
- type SheetData
- type Table
- func FormatStraightToTabular(tbl Table, colCount uint) (Table, error)
- func NewTable() Table
- func ParseBytes(data []byte, delimiter rune, hasHeaderRow bool) (Table, error)
- func ParseReader(reader io.Reader, delimiter rune, hasHeaderRow bool) (Table, error)
- func ReadFile(path string, comma rune, hasHeader, stripBom bool) (Table, error)
- func ReadFileSimple(path string, sep string, hasHeader, trimSpace bool) (Table, error)
- func ReadFilesSimple(filenames []string, sep string, hasHeader, trimSpace bool) (Table, error)
- func (tbl *Table) ColumnIndex(colName string) int
- func (tbl *Table) ColumnSumFloat64(colIdx uint) (float64, error)
- func (tbl *Table) ColumnValues(colIdx uint, wantUnique, wantSort bool) ([]string, error)
- func (tbl *Table) ColumnValuesDistinct(colIdx uint) (map[string]int, error)
- func (tbl *Table) ColumnValuesMinMax(colIdx uint) (string, string, error)
- func (tbl *Table) ColumnsValuesDistinct(wantCols []string, stripSpace bool) (map[string]int, error)
- func (tbl *Table) FilterRecordsColumnValues(wantColNameValues map[string]string) ([][]string, error)
- func (tbl *Table) FormatterFunc() func(val string, colIdx uint) (interface{}, error)
- func (tbl *Table) IsWellFormed() (isWellFormed bool, columnCount uint)
- func (tbl *Table) LoadMergedRows(data [][]string)
- func (tbl *Table) NewTableFilterColDistinctFirst(colIdx int) *Table
- func (tbl *Table) NewTableFilterColumnValues(wantColNameValues map[string]string) (Table, error)
- func (tbl *Table) RecordToMSS(record []string) map[string]string
- func (tbl *Table) RecordValue(wantCol string, record []string) (string, error)
- func (tbl *Table) RecordValueOrEmpty(wantCol string, record []string) string
- func (tbl *Table) ToSliceMSS() []map[string]string
- func (tbl *Table) Unmarshal(funcRecord func(record []string) error) error
- func (tbl *Table) UpsertRowColumnValue(rowIdx, colIdx uint, value string)
- func (tbl *Table) WriteCSV(path string) error
- func (tbl *Table) WriteJSON(path string, perm os.FileMode, jsonPrefix, jsonIndent string) error
- func (tbl *Table) WriteXLSX(path, sheetname string) error
- type TableSet
- type TabulatorColumn
- type TabulatorColumnSet
Constants ¶
const ( ExcelMaxColCount = 16384 ExcelMaxRowCount = 1048576 Alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ZZ = uint32(702) ZZIndex = uint32(701) )
const StyleSimple = "border:1px solid #000;border-collapse:collapse"
Variables ¶
var DebugReadCSV = false // should not need to use this.
Functions ¶
func ColIndexToLetters ¶
func ColNumberToLetters ¶
func CoordinateNumbersToSheetLocation ¶
CoordinateNumbersToSheetLocation converts x, y integer coordinates to a spreadsheet location such as "AA1" for col 27, row 1.
func CoordinatesToSheetLocation ¶
CoordinatesToSheetLocation converts x, y integer coordinates to a spreadsheet location such as "AA1" for col 27, row 1.
func FormatDateAndFloats ¶ added in v1.3.0
func FormatMonthAndFloats ¶ added in v1.3.0
func FormatStringAndFloats ¶
func FormatStringAndInts ¶
func FormatStrings ¶
func FormatTimeAndFloats ¶
func FormatTimeAndInts ¶
func SimpleTable ¶
func StreamSimpleTable ¶
func ToDocuments ¶
func WriteCSVSimple ¶
WriteCSVSimple writes a file with cols and records data.
func WriteSimpleTable ¶
func WriteSimpleTable(qq422016 qtio422016.Writer, table Table)
func WriteXLSXInterface ¶
Types ¶
type ColumnSet ¶ added in v0.0.4
type ColumnSet struct {
Columns []Column
}
func (*ColumnSet) DisplayTexts ¶ added in v0.0.4
type Table ¶
type Table struct { Name string Columns []string Records [][]string FormatMap map[int]string FormatFunc func(val string, colIdx uint) (interface{}, error) FormatAutoLink bool ID string Class string Style string }
Table is useful for working on CSV data
func FormatStraightToTabular ¶
FormatStraightToTabular takes a "straight table" wheere the columnn names and values are in a single column and lays it out as a standard tabular data.
func ParseReader ¶
func ReadFileSimple ¶ added in v1.3.0
func ReadFilesSimple ¶ added in v1.3.0
func (*Table) ColumnIndex ¶
func (*Table) ColumnValues ¶
func (*Table) ColumnValuesDistinct ¶
func (*Table) ColumnValuesMinMax ¶
func (*Table) ColumnsValuesDistinct ¶
func (*Table) FilterRecordsColumnValues ¶
func (tbl *Table) FilterRecordsColumnValues(wantColNameValues map[string]string) ([][]string, error)
FilterRecordsColumnValues returns a set of records filtered by column names and column values.
func (*Table) FormatterFunc ¶
func (*Table) IsWellFormed ¶
func (*Table) LoadMergedRows ¶
LoadMergedRows is used to load data from `[][]string` sources like csv.ReadAll()
func (*Table) NewTableFilterColDistinctFirst ¶
func (*Table) NewTableFilterColumnValues ¶
NewTableFilterColumnValues returns a Table filtered by column names and column values.
func (*Table) RecordValue ¶
func (*Table) RecordValueOrEmpty ¶
func (*Table) ToSliceMSS ¶
func (*Table) Unmarshal ¶
Unmarshal is a convenience function to provide a simple interface to unmarshal table contents into any desired output.
func (*Table) UpsertRowColumnValue ¶
type TableSet ¶
type TableSet struct { Columns []string RowFormatter func(val string, col uint) (interface{}, error) TableMap map[string]*Table }
func (*TableSet) TableNames ¶
func (*TableSet) TablesSorted ¶
type TabulatorColumn ¶ added in v0.0.4
type TabulatorColumnSet ¶ added in v0.0.4
type TabulatorColumnSet struct {
Columns []TabulatorColumn
}
func BuildColumnsTabulator ¶ added in v0.0.4
func BuildColumnsTabulator(columns []Column) TabulatorColumnSet
func (*TabulatorColumnSet) ColumnsJSON ¶ added in v0.0.4
func (tColSet *TabulatorColumnSet) ColumnsJSON() ([]byte, error)
func (*TabulatorColumnSet) MustColumnsJSON ¶ added in v0.0.4
func (tColSet *TabulatorColumnSet) MustColumnsJSON() []byte