38 lines
1018 B
JavaScript
38 lines
1018 B
JavaScript
import { FileBlob, SpreadsheetFile } from "@oai/artifact-tool";
|
|
|
|
const workbookPath = "D:/N7Web-Code/Cognitive_Agent/data/空调-天幕-氛围灯CAN信号矩阵表.xlsx";
|
|
const input = await FileBlob.load(workbookPath);
|
|
const workbook = await SpreadsheetFile.importXlsx(input);
|
|
|
|
const summary = await workbook.inspect({
|
|
kind: "workbook,sheet,table",
|
|
maxChars: 12000,
|
|
tableMaxRows: 8,
|
|
tableMaxCols: 20,
|
|
tableMaxCellChars: 120,
|
|
});
|
|
console.log("SUMMARY");
|
|
console.log(summary.ndjson);
|
|
|
|
const matches = await workbook.inspect({
|
|
kind: "match",
|
|
searchTerm: "42E|氛围|Ambient|颜色|色号|亮度",
|
|
options: { useRegex: true, maxResults: 300 },
|
|
maxChars: 30000,
|
|
});
|
|
console.log("MATCHES");
|
|
console.log(matches.ndjson);
|
|
|
|
const ambient42e = await workbook.inspect({
|
|
kind: "table",
|
|
sheetId: "氛围灯",
|
|
range: "A10:K27",
|
|
include: "values,formulas",
|
|
tableMaxRows: 30,
|
|
tableMaxCols: 11,
|
|
tableMaxCellChars: 500,
|
|
maxChars: 30000,
|
|
});
|
|
console.log("AMBIENT_42E");
|
|
console.log(ambient42e.ndjson);
|