This commit is contained in:
parent
2695b54460
commit
864107fca0
1 changed files with 6 additions and 0 deletions
|
@ -1345,6 +1345,7 @@ export class SystemKeywords {
|
||||||
await minioClient.fGetObject(bucketName, fileUrl, localName);
|
await minioClient.fGetObject(bucketName, fileUrl, localName);
|
||||||
|
|
||||||
csvFile = localName;
|
csvFile = localName;
|
||||||
|
GBLogEx.info(min, `Downloaded .csv: ${csvFile}.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = await fs.readFile(csvFile, 'utf8');
|
const data = await fs.readFile(csvFile, 'utf8');
|
||||||
|
@ -1352,6 +1353,9 @@ export class SystemKeywords {
|
||||||
const firstLine = data.split('\n')[0];
|
const firstLine = data.split('\n')[0];
|
||||||
const headers = firstLine.split(',');
|
const headers = firstLine.split(',');
|
||||||
const db = await csvdb(csvFile, headers, ',');
|
const db = await csvdb(csvFile, headers, ',');
|
||||||
|
|
||||||
|
GBLogEx.info(min, `READ .csv: ${csvFile}.`);
|
||||||
|
|
||||||
if (args[0]) {
|
if (args[0]) {
|
||||||
const systemFilter = await SystemKeywords.getFilter(args[0]);
|
const systemFilter = await SystemKeywords.getFilter(args[0]);
|
||||||
let filter = {};
|
let filter = {};
|
||||||
|
@ -1361,6 +1365,8 @@ export class SystemKeywords {
|
||||||
res = await db.get();
|
res = await db.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GBLogEx.info(min, `ROWS: ${res.length}.`);
|
||||||
|
|
||||||
return res.length > 1 ? res : res[0];
|
return res.length > 1 ? res : res[0];
|
||||||
} else {
|
} else {
|
||||||
const t = this.getTableFromName(file, min);
|
const t = this.getTableFromName(file, min);
|
||||||
|
|
Loading…
Add table
Reference in a new issue