Documentation ¶
Index ¶
- Variables
- func FilterCSVFile(inPath, outPath string, inComma rune, inStripBom bool, ...) error
- func MergeFilterCSVFiles(inPaths []string, outPath string, inComma rune, inStripBom bool, ...) error
- func MergeFilterCSVFilesToJSON(inPaths []string, outPath string, inComma rune, inStripBom bool, ...) error
- func MergeFilterCSVFilesToJSONL(inPaths []string, outPath string, inComma rune, inStripBom bool, ...) error
- func NewReader(path string, comma rune, stripBom bool) (*csv.Reader, *os.File, error)
- func NewTableDataFileCSV(path string, comma rune, stripBom bool) (table.TableData, error)
- func NewTableDataFileSimple(path string, sep string, hasHeader, trimSpace bool) (table.TableData, error)
- func NewTableDataFilesSimple(filenames []string, sep string, hasHeader, trimSpace bool) (table.TableData, error)
- func NewWriterFile(filename string) (*csv.Writer, *os.File, 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 ReadMergeFilterCSVFiles(inPaths []string, outPath string, inComma rune, inStripBom bool, ...) (table.DocumentsSet, error)
- func WriteCSVFiltered(reader *csv.Reader, writer *csv.Writer, ...) error
- type CSVHeader
- type Writer
Constants ¶
This section is empty.
Variables ¶
View Source
var DebugReadCSV = false // should not need to edit
Functions ¶
func FilterCSVFile ¶
func MergeFilterCSVFiles ¶
func MergeFilterCSVFiles(inPaths []string, outPath string, inComma rune, inStripBom bool, andFilter map[string]stringsutil.MatchInfo) error
MergeFilterCSVFiles can merge and filter multiple CSV files. It expects row definitions to be the same across all input files.
func NewReader ¶
NewReader will create a csv.Reader and optionally strip off the byte order mark (BOM) if requested. Close file reader with `defer f.Close()`.
func NewTableDataFileCSV ¶
NewTableDataFileCSV reads in a CSV file and returns a TableData struct.
func NewTableDataFileSimple ¶
func NewTableDataFilesSimple ¶
func ReadMergeFilterCSVFiles ¶
func ReadMergeFilterCSVFiles(inPaths []string, outPath string, inComma rune, inStripBom bool, andFilter map[string]stringsutil.MatchInfo) (table.DocumentsSet, error)
Types ¶
type Writer ¶
type Writer struct { Separator string StripRepeatedSep bool ReplaceSeparator bool SeparatorAlt string File *os.File }
Writer is a struct for a CSV/TSV writer.
Click to show internal directories.
Click to hide internal directories.