mirror of
https://github.com/christianvidalwolf-prog/CrazeAnalytix.git
synced 2026-08-03 22:45:23 +02:00
Cleanup temporary diagnostic files
This commit is contained in:
@@ -1,25 +0,0 @@
|
|||||||
const XLSX = require('xlsx');
|
|
||||||
const path = require('path');
|
|
||||||
|
|
||||||
function inspectForecast(filename, targetSku) {
|
|
||||||
const filePath = path.join(process.cwd(), 'public', filename);
|
|
||||||
const workbook = XLSX.readFile(filePath);
|
|
||||||
const sheetName = workbook.SheetNames[0];
|
|
||||||
const sheet = workbook.Sheets[sheetName];
|
|
||||||
const data = XLSX.utils.sheet_to_json(sheet);
|
|
||||||
|
|
||||||
console.log(`Searching for SKU: ${targetSku} in ${filename}`);
|
|
||||||
const results = data.filter(row =>
|
|
||||||
String(row['SKU'] || row['sku'] || '').includes(targetSku) ||
|
|
||||||
String(row['ASIN'] || row['asin'] || '').includes(targetSku)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (results.length === 0) {
|
|
||||||
console.log('No results found.');
|
|
||||||
} else {
|
|
||||||
results.forEach(r => console.log(JSON.stringify(r, null, 2)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const targetSku = process.argv[2] || '46234';
|
|
||||||
inspectForecast('fc UK 26.xlsx', targetSku);
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
|
|
||||||
const XLSX = require('xlsx');
|
|
||||||
|
|
||||||
async function inspect() {
|
|
||||||
const workbook = XLSX.readFile('Item Availability.xlsx');
|
|
||||||
const sheet = workbook.Sheets[workbook.SheetNames[0]];
|
|
||||||
const data = XLSX.utils.sheet_to_json(sheet, { header: 1 });
|
|
||||||
|
|
||||||
console.log('--- HEADERS ---');
|
|
||||||
console.log(data[0]);
|
|
||||||
|
|
||||||
console.log('\n--- DATA (Top 5) ---');
|
|
||||||
console.log(data.slice(1, 6));
|
|
||||||
}
|
|
||||||
|
|
||||||
inspect();
|
|
||||||
Binary file not shown.
Reference in New Issue
Block a user