-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.js
40 lines (36 loc) · 1.15 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
const concept = require('./concept');
const parse = require('./masterParsing.js')
const aggregate = require('./aggregateJSONS.js');
const fs = require('fs');
// const otherDirection = require('./otherDirection');
let files = fs.readFileSync('files.csv', {encoding:'utf8'})
files = files.split(',')
console.log(files)
let changed = false;
for(let i = 0; i < files.length; i++){
let file = files[i]
if(file.includes("masterFile.csv")){
const fs = require('fs');
fs.readdirSync('./jsons/').forEach(file => {
if((file.match(/[0-9]+.json/))){
fs.unlink('./jsons/' + file, (err) => {
if(err){
console.error(err)
return
}
})
}
})
concept.readFile(file).then(() => {
// parse.parseMasterModule()
aggregate.aggregate()
}).catch(error => {console.log(error)})
// changed = true;
i = files.length;
}
/*else if(file.match(/[0-9]+.json/)){
otherDirection.reverseRead()
i = files.length;
changed = true;
} */
}