xlsx-cli support rawNumbers option

This commit is contained in:
Simon Weigl 2024-01-29 14:26:01 -08:00
parent 29d46c07a8
commit c266bcc225

View File

@ -52,6 +52,7 @@ function run() {
.option('-F, --field-sep <sep>', 'CSV field separator', ",")
.option('-R, --row-sep <sep>', 'CSV row separator', "\n")
.option('--raw-numbers', 'CSV raw numbers')
.option('-n, --sheet-rows <num>', 'Number of rows to process (0=all rows)')
.option('--date-format <string>', 'output date format, for example yyyy-mm-dd')
.option('--codepage <cp>', 'default to specified codepage when ambiguous')
@ -274,10 +275,10 @@ function run() {
default:
if (!program.book) {
var stream = X.stream.to_csv(ws, { FS: program.fieldSep, RS: program.rowSep });
var stream = X.stream.to_csv(ws, { FS: program.fieldSep, RS: program.rowSep, rawNumbers: program.rawNumbers });
if (program.output) stream.pipe(fs.createWriteStream(program.output));
else stream.pipe(process.stdout);
} else doit(function (ws) { return X.utils.sheet_to_csv(ws, { FS: program.fieldSep, RS: program.rowSep }); });
} else doit(function (ws) { return X.utils.sheet_to_csv(ws, { FS: program.fieldSep, RS: program.rowSep, rawNumbers: program.rawNumbers }); });
break;
}