Commit c9151111 authored by Ahmad Nemati's avatar Ahmad Nemati

git pu

parent 66088044
......@@ -151,7 +151,7 @@ async function copyAllFiles()
}
}
await writeFileDetail([])
// init()
init()
}
function sleep(millis) {
......
......@@ -11,15 +11,30 @@ async function init() {
}
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 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')) {
try {
await format(files[i])
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) {
......@@ -90,7 +105,7 @@ async function format(name) {
function createFile(name, body) {
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);
else resolve(true);
});
......@@ -98,6 +113,9 @@ function createFile(name, body) {
}
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