csv

Play with csv file(s). The tool is based on Go's encoding/csv package.
Install
- Install in
GOBIN or ~/go/bin:
go get github.com/shmsr/csv
go build
Usage
Usage of csv:
-clrf
(Writer) If CRLF (crlf) is true, then use \r\n as the line terminator.
-debug
(Writer) Debug field parsed by the CSV reader. Dumps to standard error (2).
-f string
(Reader) Read the file to be be parsed.
-fps
(Reader) If FieldsPerRecord (fps) is true, no check is made and records may have a variable number of fields.
-fs string
(Reader) Specify index of required columns (separated by comma(s), 1 indexing). If empty, print all fields.
-lq
(Reader) If LazyQuotes (lq) is true, a quote may appear in an unquoted field and a non-doubled quote may appear in a quoted field.
-rd string
(Reader) Specify reader delimiter (single unicode character). (default ",")
-tls
(Reader) If TrimLeadingSpace (tls) is true, leading white space in a field is ignored. This is done even if the field delimiter, Comma, is white space.
-v (Writer) Just validates the csv file and logs errors (if any).
-wd string
(Writer) Specify writer delimiter (single unicode character). (default " ")
Example
./csv -f <filename> -rd ";" -wd "|"
The tool reads the file using the delimiter ; and prints the record(s) with delimiter | to stdout.