This commit is contained in:
@@ -63,11 +63,10 @@ export default async function parseThisShit(downloadedFilePath) {
|
|||||||
let classI = 0;
|
let classI = 0;
|
||||||
for (const matchingKey of matchingKeys) {
|
for (const matchingKey of matchingKeys) {
|
||||||
const allKeys = Object.keys(currentSheet).filter(key => key !== matchingKey && key.replace(/[a-z]/gi, '') == matchingKey.replace(/[a-z]/gi, ''));
|
const allKeys = Object.keys(currentSheet).filter(key => key !== matchingKey && key.replace(/[a-z]/gi, '') == matchingKey.replace(/[a-z]/gi, ''));
|
||||||
|
let final2 = [];
|
||||||
const final2 = [];
|
|
||||||
|
|
||||||
for (const key of allKeys) {
|
for (const key of allKeys) {
|
||||||
const parsedKey = letterToNumber(key.replace(/[0-9]/gi, ''));
|
const parsedKey = letterToNumber(key.replace(/[0-9]/gi, '')) - 1;
|
||||||
let d = true;
|
let d = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@@ -83,6 +82,11 @@ export default async function parseThisShit(downloadedFilePath) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final2 = Array.from(final2, item => item === undefined ? null : item);
|
||||||
|
while (final2.length < 10) {
|
||||||
|
final2.push(null);
|
||||||
|
}
|
||||||
|
|
||||||
final[finalIndex][classes[classI]] = final2.slice(1, 11);;
|
final[finalIndex][classes[classI]] = final2.slice(1, 11);;
|
||||||
|
|
||||||
classI++;
|
classI++;
|
||||||
@@ -113,6 +117,7 @@ export default async function parseThisShit(downloadedFilePath) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
finalIndex++;
|
finalIndex++;
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
@@ -144,4 +149,4 @@ export default async function parseThisShit(downloadedFilePath) {
|
|||||||
fs.writeFileSync('db/current.json', JSON.stringify(data));
|
fs.writeFileSync('db/current.json', JSON.stringify(data));
|
||||||
}
|
}
|
||||||
|
|
||||||
// parseThisShit("downloads/table.xlsx");
|
parseThisShit("downloads/table.xlsx");
|
||||||
|
|||||||
Reference in New Issue
Block a user