Commit c9151111 authored by Ahmad Nemati's avatar Ahmad Nemati

git pu

parent 66088044
...@@ -151,7 +151,7 @@ async function copyAllFiles() ...@@ -151,7 +151,7 @@ async function copyAllFiles()
} }
} }
await writeFileDetail([]) await writeFileDetail([])
// init() init()
} }
function sleep(millis) { function sleep(millis) {
......
...@@ -11,15 +11,30 @@ async function init() { ...@@ -11,15 +11,30 @@ async function init() {
} }
let files = await fs.readdirSync('files') let files = await fs.readdirSync('files')
let arr=[]
for (let i = 0; i < files.length; i++) {
if (files[i].includes('R'))
continue
arr.push(files[i])
}
files=arr
let prom = [] let prom = []
let num=50 let num=50
for (let i = 0; i < files.length; i++) { for (let i = 0; i < files.length; i=i+10) {
if (files[i].includes('.csv')) { if (files[i].includes('.csv')) {
try { try {
format(files[i])
await format(files[i]) format(files[i+1])
format(files[i+2])
format(files[i+3])
format(files[i+4])
format(files[i+5])
format(files[i+6])
format(files[i+7])
format(files[i+8])
await format(files[i+9])
} catch (e) { } catch (e) {
...@@ -90,7 +105,7 @@ async function format(name) { ...@@ -90,7 +105,7 @@ async function format(name) {
function createFile(name, body) { function createFile(name, body) {
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
fs.writeFile('allFiles/' + name, body, 'utf8', function (err) { fs.writeFile('files/' + name, body, 'utf8', function (err) {
if (err) reject(err); if (err) reject(err);
else resolve(true); else resolve(true);
}); });
...@@ -98,6 +113,9 @@ function createFile(name, body) { ...@@ -98,6 +113,9 @@ function createFile(name, body) {
} }
module.exports = module.exports =
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment