|
@@ -0,0 +1,26 @@
|
|
|
+const readline = require('readline');
|
|
|
+const file = require('./src/file');
|
|
|
+const fs = file.fs;
|
|
|
+
|
|
|
+const path = './data/opti/';
|
|
|
+const source = './data/preprocess.ppf';
|
|
|
+let data = {};
|
|
|
+
|
|
|
+file.makedir(path);
|
|
|
+
|
|
|
+const reader = readline.createInterface({
|
|
|
+ input: fs.createReadStream(source)
|
|
|
+});
|
|
|
+reader.on('line', (line) => {
|
|
|
+ const group = JSON.parse(line);
|
|
|
+ group.forEach(auth => {
|
|
|
+ let coauth = JSON.parse(line);
|
|
|
+ coauth.splice(coauth.indexOf(auth), 1);
|
|
|
+ coauth.forEach(elt => {
|
|
|
+ file.append(path + auth, elt + '\n');
|
|
|
+ });
|
|
|
+ });
|
|
|
+});
|
|
|
+reader.on('close', () => {
|
|
|
+ console.log('Fin');
|
|
|
+});
|