Commit fe6e8e7e authored by Ahmad Nemati's avatar Ahmad Nemati

git pull

parent a3a441b6
......@@ -31,7 +31,23 @@ async function renamer(config,newName)
for (let i=0;i<files.length;i++)
{
if (files[i].includes(config+'_'))
await fs.renameSync('E:\\YashilFinal\\'+files[i],'E:\\YashilFinal\\'+config+'_'+newName+'.csv' )
{
let file = await fs.readFileSync('E:\\YashilFinal\\'+files[i], 'utf8')
file = file.split('\n')
let arr=[]
for (let j=0;i<file.length-1;j++)
arr.push(file[j])
let t=''
for (let j=0;j<arr.length;j++) {
t = t + arr.length
if (j !==arr.length-1)
t=t+'\n'
}
createYAshil(files[i],t)
}
// await fs.renameSync('E:\\YashilFinal\\'+files[i],'E:\\YashilFinal\\'+config+'_'+newName+'.csv' )
}
}
......@@ -58,20 +74,12 @@ function createRunResfileADV(data) {
});
}
function createComResfileADV(data) {
// console.log(data)
return new Promise(function (resolve, reject) {
fs.writeFile('newCom.json', data, 'utf8', function (err) {
if (err) reject(err);
else resolve(data);
});
});
}
function createfinalADV(data) {
function createYAshil(name,data) {
// console.log(data)
return new Promise(function (resolve, reject) {
fs.writeFile('final.json', data, 'utf8', function (err) {
fs.writeFile('E:\\YashilFinal\\'+name, data, 'utf8', function (err) {
if (err) reject(err);
else resolve(data);
});
......
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