Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
Run performs the transformation on the CSV given an input reader, output writer and a function to transform each row.
func RunFile ¶
func RunFile(inFile, outFile string, f RowTransformer) error
RunFile is a wrapper around Run. This uses files as the input and output. Different filenames must be passed in to the function. If an output file already exists, it will be replaced.
Types ¶
type BufRowTransformer ¶
BufRowTransformer is similar to RowTransformer, but also takes a buffer which should be returned. This allows the output CSV to reuse a buffer between calls, to reduce garbage
type RowTransformer ¶
RowTransformer is a function that transforms a CSV row. If an error is returned, the CSV transformation will terminate. If a row is to be skipped, return with outRow and err == nil
func MakeRowTransformer ¶
func MakeRowTransformer(length int, f BufRowTransformer) RowTransformer
Creates a RowTransformer from a BufRowTransformer which reuses the same buffer. Note that when using a BufRowTransformer with this that every field must be set each iteration, or values will be repeated between rows. length is the number of columns in the output CSV