1
1
mirror of https://github.com/wader/fq.git synced 2024-12-24 22:05:31 +03:00
fq/format/csv/testdata/help_csv.fqtest
Mattias Wadman a7a101ca67 doc,help: Nicer format help and move help tests into each format
Also add authors to avro and macho decoders

Generated with:
for i in $(go run . -r -n '_registry | [([([.files[][].name | split(".")[0]] | unique[]), (.formats[].name)] | count[] | select(.[1] == 2)[0]), (.formats[] | select(.decode_in_arg).name)] | unique[]'); do DIR=$(dirname $(find format -name $i.go)); echo "$ fq -h $i" > "$DIR/testdata/help_$i.fqtest" ; done
2022-09-22 23:07:58 +02:00

32 lines
636 B
Plaintext

$ fq -h csv
csv: Comma separated values decoder
Options
=======
comma=, Separator character
comment=# Comment line character
Decode examples
===============
# Decode file as csv
$ fq -d csv . file
# Decode value as csv
... | csv
# Decode file using csv options
$ fq -d csv -o comma="," -o comment="#" . file
# Decode value as csv
... | csv({comma:",",comment:"#"})
TSV to CSV
==========
$ fq -d csv -o comma="\t" tocsv file.tsv
Convert rows to objects based on header row
===========================================
$ fq -d csv '.[0] as $t | .[1:] | map(with_entries(.key = $t[.key]))' file.csv