Commit 0f282f1e authored by Ahmad Nemati's avatar Ahmad Nemati

git pull

parent 7099fdc8
......@@ -14,15 +14,19 @@ async function init() {
let com = await fs.readFileSync('newCom_last.json', 'utf8');
files = await fs.readdirSync('E:\\YashilFinal')
com = JSON.parse(com)
// console.log(com)
// for (let i = 0; i < com.length; i++) {
// await renamer(com[i].config,com[i].uniq)
//
// }
// console.log(com)
for (let i = 0; i < com.length; i++) {
await renamer(com[i].config,com[i].uniq)
}
files = await fs.readdirSync('E:\\YashilFinal')
for (let i = 0; i < com.length; i++) {
await remover(com[i].config,com[i].uniq)
}
files = await fs.readdirSync('E:\\YashilFinal')
let tempFiles = await fs.readdirSync('C:\\Users\\Administrator\\Desktop\\ai\\temp\\')
for (let i = 0; i < tempFiles.length; i++) {
let f = await fs.readFileSync('C:\\Users\\Administrator\\Desktop\\ai\\temp\\' + tempFiles[i], 'utf8');
......@@ -34,8 +38,7 @@ async function init() {
await append(format, f)
// console.log(format)
}
//console.log(tempFiles)
......@@ -62,7 +65,18 @@ console.log(data)
}
async function renamer(config, newName) {
for (let i = 0; i < files.length; i++) {
if (files[i].includes('Lp1_'+config))
await fs.renameSync('E:\\YashilFinal\\'+files[i],'E:\\YashilFinal\\'+config+'_'+newName+'.csv' )
}
}
async function remover(config, newName) {
for (let i = 0; i < files.length; i++) {
if (files[i].includes(config + '_')) {
let file = await fs.readFileSync('E:\\YashilFinal\\' + files[i], 'utf8')
file = file.split('\n')
......@@ -77,12 +91,11 @@ async function renamer(config, newName) {
if (j !== arr.length - 1)
t = t + '\n'
}
createYAshil(files[i], t)
await createYAshil(files[i], t)
}
// if (files[i].includes('Lp1_'+config))
// await fs.renameSync('E:\\YashilFinal\\'+files[i],'E:\\YashilFinal\\'+config+'_'+newName+'.csv' )
}
}
......
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