Commit abd3bd81 authored by Ahmad Nemati's avatar Ahmad Nemati

git pull

parent 9dccbcae
...@@ -16,14 +16,14 @@ async function init() { ...@@ -16,14 +16,14 @@ async function init() {
com = JSON.parse(com) com = JSON.parse(com)
// console.log(com) // console.log(com)
for (let i = 0; i < com.length; i++) { for (let i = 0; i < com.length; i++) {
await renamer(com[i].config,com[i].uniq) await renamer(com[i].config, com[i].uniq)
} }
files = await fs.readdirSync('E:\\YashilFinal') files = await fs.readdirSync('E:\\YashilFinal')
for (let i = 0; i < com.length; i++) { for (let i = 0; i < com.length; i++) {
await remover(com[i].config,com[i].uniq) await remover(com[i].config, com[i].uniq)
} }
files = await fs.readdirSync('E:\\YashilFinal') files = await fs.readdirSync('E:\\YashilFinal')
...@@ -36,7 +36,7 @@ await renamer(com[i].config,com[i].uniq) ...@@ -36,7 +36,7 @@ await renamer(com[i].config,com[i].uniq)
let format = tempFiles[i] let format = tempFiles[i]
// console.log(format) // console.log(format)
format = format.replace('Kelt', 'btc4').replace('SOTT', 'btc3').replace('Pmax', 'btc2').replace('PPST', 'btc1').replace('.csv','') format = format.replace('Kelt', 'btc4').replace('SOTT', 'btc3').replace('Pmax', 'btc2').replace('PPST', 'btc1').replace('.csv', '')
append(format, f) append(format, f)
// console.log(format,f) // console.log(format,f)
// //
...@@ -49,9 +49,11 @@ await renamer(com[i].config,com[i].uniq) ...@@ -49,9 +49,11 @@ await renamer(com[i].config,com[i].uniq)
async function append(config, data) { async function append(config, data) {
console.log(config + '_') console.log(config + '_')
for (let i = 0; i < files.length; i++) {
if (files[i].startsWith(config+'_')) { for (let i = 0; i < files.length; i++) {
if (files[i].includes(config))
console.log(files[i])
if (files[i].startsWith(config + '_')) {
// console.log(config,files[i]) // console.log(config,files[i])
console.log(files[i]) console.log(files[i])
for (let j = 0; j < data.length; j++) for (let j = 0; j < data.length; j++)
...@@ -72,8 +74,8 @@ async function appender(file, data) { ...@@ -72,8 +74,8 @@ async function appender(file, data) {
async function renamer(config, newName) { async function renamer(config, newName) {
for (let i = 0; i < files.length; i++) { for (let i = 0; i < files.length; i++) {
if (files[i].includes('Lp1_'+config)) if (files[i].includes('Lp1_' + config))
await fs.renameSync('E:\\YashilFinal\\'+files[i],'E:\\YashilFinal\\'+config+'_'+newName+'.csv' ) await fs.renameSync('E:\\YashilFinal\\' + files[i], 'E:\\YashilFinal\\' + config + '_' + newName + '.csv')
} }
} }
...@@ -82,7 +84,7 @@ async function remover(config, newName) { ...@@ -82,7 +84,7 @@ async function remover(config, newName) {
for (let i = 0; i < files.length; i++) { for (let i = 0; i < files.length; i++) {
if (files[i].startsWith(config+'_')) { if (files[i].startsWith(config + '_')) {
let file = await fs.readFileSync('E:\\YashilFinal\\' + files[i], 'utf8') let file = await fs.readFileSync('E:\\YashilFinal\\' + files[i], 'utf8')
file = file.split('\n') file = file.split('\n')
//console.log(file) //console.log(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