Commit 9c6fab99 authored by Ahmad Nemati's avatar Ahmad Nemati

git pu

parent e04be4cb
...@@ -6,24 +6,31 @@ init() ...@@ -6,24 +6,31 @@ init()
async function init() { async function init() {
let files = await fs.readdirSync('RunRes') let files = await fs.readdirSync('RunRes')
let prom=[] let prom = []
let arr=[] let all=[]
for (let i = 0; i < files.length; i++) { for (let i = 0; i < files.length; i++) {
if (files[i].includes('.csv')) { if (files[i].includes('.csv')) {
let last = files[i].split('_')
let file = last[last.length - 1].replace('.csv', '')
try { try {
prom.push(format(files[i] )) let res = await format(files[i])
} let arr = []
catch (e) for (let z = 1; z < res.length; z++)
{ arr.push(res[z])
all.push({name:file,data:arr})
} catch (e) {
} }
} }
} }
let r= await Promise.all(prom)
// console.log(r) console.log(all)
} }
......
...@@ -2,4 +2,7 @@ let _=require('lodash') ...@@ -2,4 +2,7 @@ let _=require('lodash')
let arr=[2,3,5,1,2,2] let arr=[2,3,5,1,2,2]
let t='last.json-220217123102_O1_BNC_ETHUSDT_Lp919_1ETH8.csv' let t='last.json-220217123102_O1_BNC_ETHUSDT_Lp919_1ETH8.csv'
console.log(t.split('-')) let last=t.split('_')
\ No newline at end of file let config=last[last.length-2].replace('.csv','')
let file=last[last.length-1].replace('.csv','')
console.log(file)
\ 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