jsonifycsv

NAME

jsonifycsv – Convert .csv data into JSON data

SYNOPSIS

Usage: jsonifycsv [OPTION]...
convert a .csv file into a flatish json file

  -h, --help                    Print help and exit
      --detailed-help           Print help, including all details and hidden
                                  options, and exit
  -V, --version                 Print version and exit

debugging:
  -d, --debug                   Print random debugging messages

input format:
  -l, --labels                  The first row of the .csv file contains labels
                                  for subsequent rows  (default=off)

output formatting:
  -m, --missing-value="null"|"string"
                                Value to take the place of missing values
                                  (default=`null')
  -M, --empty-string-as-missing Treat empty strings ("") with
                                  "--missing-value"  (default=off)
  -n, --numeric                 Print unquoted strings that look like numbers
                                  as numbers on output  (default=off)
  -N, --Numeric                 Like `-n`, but for both quoted and unquoted
                                  string  (default=off)

DESCRIPTION

Convert .csv data to JSON data. If no file name is specified on the command line, input is read from stdin. Output is always written to stdout. In doing the translation, there are a few places where different users might want different behavior, so there are several options.

-d, –debug
Print additional debugging information
-h, –help
Print the above help message
-l, –labels
The input .csv data's first row contains column labels. in this case, the output consists of an array of json "objects"; otherwise, the output consists of an array of arrays.
-m, –missing-values ["string"|"null"]
How should missing data (empty columns) in the .csv data be handled? If "string" is specified, an empty string is used as the value; if "null" is specified, the JSON vaue null is used.
-M, –empty-string-as-missing
Should columns whose value is the empty string ("") be treated in the same way as -m? Practically, this only makes sense when -m null is specified.
-n, –numeric
Unquoted strings in the .csv data that look like numbers (+3.2e-23) should be output as JSON numbers. (The default is to output them as JSON strings.)
-N, –Numeric
Quoted strings in the .csv data that look like numbers should be output as JSON numbers.

BUGS

The -m, -M, -n, -N options should be specifiable on a per-column basis.

Author: Linux User

Created: 2022-04-04 Mon 03:55

Validate