Adding CSV decoder

This commit is contained in:
Mike Farah 2022-07-31 17:35:36 +10:00
parent 183a42c249
commit cb0bae128f
6 changed files with 13 additions and 4 deletions

View File

@ -0,0 +1,3 @@
name,numberOfCats,likesApples,height
Gary,1,true,168.8
Samantha's Rabbit,2,false,-188.8
1 name numberOfCats likesApples height
2 Gary 1 true 168.8
3 Samantha's Rabbit 2 false -188.8

View File

@ -34,9 +34,9 @@ func InputFormatFromString(format string) (InputFormat, error) {
return PropertiesInputFormat, nil
case "json", "ndjson", "j":
return JsonInputFormat, nil
case "csv":
case "csv", "c":
return CSVObjectInputFormat, nil
case "tsv":
case "tsv", "t":
return TSVObjectInputFormat, nil
default:
return 0, fmt.Errorf("unknown format '%v' please use [yaml|xml|props]", format)

View File

@ -1,3 +1,6 @@
# CSV
Encode (arrays of arrays) data structures to CSV or TSV, Decode CSV, TSV into an array of objects.
{% hint style="warning" %}
Note that versions prior to 4.18 require the 'eval/e' command to be specified. 

View File

@ -0,0 +1,3 @@
# CSV
Encode (arrays of arrays) data structures to CSV or TSV, Decode CSV, TSV into an array of objects.

View File

@ -1,5 +1,5 @@
# Properties
Encode to a property file (decode not yet supported). Line comments on value nodes will be copied across.
Encode/Decode to/from a property file. Line comments on value nodes will be copied across.
By default, empty maps and arrays are not encoded - see below for an example on how to encode a value for these.

View File

@ -1,6 +1,6 @@
# Properties
Encode to a property file (decode not yet supported). Line comments on value nodes will be copied across.
Encode/Decode to/from a property file. Line comments on value nodes will be copied across.
By default, empty maps and arrays are not encoded - see below for an example on how to encode a value for these.