Documentation ¶
Overview ¶
Package kut provides column cutting for CSV (RFC 4180) files.
Index ¶
Constants ¶
const EOL = int(^uint(0) >> 1)
EOL can be used as the End in a ColRange to include all remaining columns.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ColRange ¶
A ColRange specifies a range of columns to include. Column numbers begin at 1. Both Start and End are inclusive.
type Cutter ¶
type Cutter struct { Ranges []ColRange // contains filtered or unexported fields }
A Cutter reads from an input CSV and writes only the specified columns to an output CSV.
func (*Cutter) Scan ¶
Scan advances one record on the input, outputting only the columns specified in Ranges. If there is no input left to read, Scan returns io.EOF.
func (*Cutter) ScanAll ¶
ScanAll advances to the end of the input, outputting only the columns specified in Ranges. Because ScanAll deliberately reads until io.EOF, it does not report io.EOF as an error.
func (*Cutter) SetDelimiter ¶
SetDelimiter sets the field delimiter, which defaults to a comma.