Documentation
¶
Index ¶
- func CsvRecordIterator(csvFilePath string) (iter.Seq2[[]string, error], error)
- func FileLinesIterator(csvFilePath string) (iter.Seq[string], error)
- func MergeCsvFiles(outputCsvPath string, hasHeader bool, inputCsvFiles ...string) error
- func ReadFileContent[T FileContent](filePath string) (T, error)
- type CsvWriter
- type FileContent
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CsvRecordIterator ¶ added in v0.3.0
CsvRecordIterator returns a Seq2 iterator which includes the csvRecord and any errorlib encountered during the read operation.
func FileLinesIterator ¶ added in v0.3.0
FileLinesIterator returns a Seq containing a single file line.
func MergeCsvFiles ¶ added in v0.3.0
MergeCsvFiles merges the provided inputFiles into a single file located at outputCsvPath. The first file in inputFiles establishes the merge file's structure and header row if hasHeader is true
func ReadFileContent ¶
func ReadFileContent[T FileContent](filePath string) (T, error)
ReadFileContent returns the contents of a file as FileContent.
Types ¶
type CsvWriter ¶ added in v0.2.0
type CsvWriter struct {
// contains filtered or unexported fields
}
CsvWriter writes CSV records to an output file. Use NewCsvWriter to create new instances and Close to close the underlying file.
func NewCsvWriter ¶ added in v0.2.0
NewCsvWriter creates a new CsvWriter instance.
type FileContent ¶
FileContent is the type set used in ReadFileContents