You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.example("$0 oecd.json oecd-array.json", "converts JSON-stat file oecd.json into a new file (oecd-array.json) containing an array of arrays.")
.example("$0 < oecd.json > oecd-array.json -t", "converts JSON-stat stream oecd.json into a new stream (oecd-array.json) containing an array of arrays.")
.boolean("s")
.alias("s", "status")
.describe("s", "Include status information")
.alias("v", "vlabel")
.describe("v", "Label of the value field (default is 'Value')")
.alias("l", "slabel")
.describe("l", "Label of the status field (default is 'Status')")
.boolean("f")
.alias("f", "fid")
.describe("f", "Identify dimensions, value and status by ID instead of label")
.boolean("c")
.alias("c", "cid")
.describe("c", "Identify categories by ID instead of label")
.boolean("t")
.alias("t", "stream")
.describe("t", "Enable the stream interface")
.help("h")
.alias("h", "help")
.argv
,
inout=require("./inout"),
callback=function(contents){
const
tbl=inout.dataset(contents).Transform({
type: "array",
vlabel: argv.vlabel,
slabel: argv.slabel,
status: argv.status,
content: argv.cid ? "id": "label",
field: argv.fid ? "id": "label"
})
;
if(tbl===null){
console.error("Error: The input does not containt valid JSON-stat.");