mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 18:25:24 +02:00
19 lines
639 B
JavaScript
19 lines
639 B
JavaScript
import * as XLSX from 'xlsx';
|
|||
|
|
import * as fs from 'fs';
|
||
|
|
|
||
|
|
const buf = fs.readFileSync('data (3).xlsx');
|
||
|
|
const wb = XLSX.read(buf, {type: 'buffer'});
|
||
|
|
const ws = wb.Sheets[wb.SheetNames[0]];
|
||
|
|
const data = XLSX.utils.sheet_to_json(ws, {header: 1});
|
||
|
|
|
||
|
|
const itemRow = data.find(r => String(r[0]) === '75432');
|
||
|
|
if (itemRow) {
|
||
|
|
console.log('Row for 75432:');
|
||
|
|
console.log(`Index 0 (Article No): ${itemRow[0]}`);
|
||
|
|
console.log(`Index 31 (Units Inner): ${itemRow[31]}`);
|
||
|
|
console.log(`Index 32 (Units Outer): ${itemRow[32]}`);
|
||
|
|
console.log(`Index 33 (Units Pallet): ${itemRow[33]}`);
|
||
|
|
} else {
|
||
|
|
console.log('Item 75432 not found');
|
||
|
|
}
|