... | @@ -15,12 +15,12 @@ The overall structure of CSV to JSON conversion has 3 phases. |
... | @@ -15,12 +15,12 @@ The overall structure of CSV to JSON conversion has 3 phases. |
|
|
|
|
|
One possible translation scheme for CSV to JSON is straightforward and universally
|
|
One possible translation scheme for CSV to JSON is straightforward and universally
|
|
applicable to produce a correct JSON format.
|
|
applicable to produce a correct JSON format.
|
|
1. Every CSV data record is translated into a JSON object with key-value pairs enclosed in "{}".
|
|
1. Every CSV data record is translated into a JSON object with key-value pairs enclosed in "`{}`".
|
|
2. CSV headers become the keys for each key-value pair.
|
|
2. CSV headers become the keys for each key-value pair.
|
|
3. The data values in each column of each CSV record are translated into JSON strings enclosed in double quotes (").
|
|
3. The data values in each column of each CSV record are translated into JSON strings enclosed in double quotes (`"`).
|
|
|
|
|
|
Although this scheme is universal, it could be preferable to translate some data values
|
|
Although this scheme is universal, it could be preferable to translate some data values
|
|
into JSON numbers, booleans or the {{{null}}} value instead. However, we first consider
|
|
into JSON numbers, booleans or the `null` value instead. However, we first consider
|
|
the universal scheme in order to illustrate the simplest application of Parabix methods
|
|
the universal scheme in order to illustrate the simplest application of Parabix methods
|
|
to this problem.
|
|
to this problem.
|
|
|
|
|
... | | ... | |