Commit 7378af2d authored by Ahmad Nemati's avatar Ahmad Nemati

git pu

parent be0de69c
const fs = require('fs')
let moment = require('moment-timezone')
init()
async function init() {
let files = await fs.readdirSync('RunRes')
let prom=[]
for (let i = 0; i < files.length; i++) {
if (files[i].includes('.csv')) {
try {
prom.push(format(files[i] ))
}
catch (e)
{
}
}
}
let r= await Promise.all(prom)
console.log(r)
}
async function format(name) {
let res = await fs.readFileSync('./RunRes/' + name, 'utf8');
res = res.split('\n')
return res
}
function createFile(name, body) {
return new Promise(function (resolve, reject) {
fs.writeFile('files/' + name, body, 'utf8', function (err) {
if (err) reject(err);
else resolve(true);
});
});
}
\ No newline at end of file
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