Commit 85ded142 authored by Ahmad Nemati's avatar Ahmad Nemati

git pull

parent 948cfb96
...@@ -16,7 +16,7 @@ let arr=[] ...@@ -16,7 +16,7 @@ let arr=[]
{ {
if (!files[i].includes('.csv')) if (!files[i].includes('.csv'))
continue continue
arr.push(read('E:\\fail\\btc1\\'+files[i])) arr.push(read('E:\\fail\\btc1\\'+files[i],files[i]))
} }
let files2 = await fs.readdirSync('E:\\fail\\btc2') let files2 = await fs.readdirSync('E:\\fail\\btc2')
...@@ -24,7 +24,7 @@ let arr=[] ...@@ -24,7 +24,7 @@ let arr=[]
{ {
if (!files2[i].includes('.csv')) if (!files2[i].includes('.csv'))
continue continue
arr.push(read('E:\\fail\\btc2\\'+files2[i])) arr.push(read('E:\\fail\\btc2\\'+files2[i],files2[i]))
} }
// console.log(files) // console.log(files)
...@@ -35,12 +35,20 @@ let arr=[] ...@@ -35,12 +35,20 @@ let arr=[]
} }
async function read(dir) async function read(dir,name)
{ {
let arr=[]
let com = await fs.readFileSync(dir, 'utf8'); let com = await fs.readFileSync(dir, 'utf8');
com=com.split('\n') com=com.split('\n')
console.log(com.length) name=name.split('_')
// for (let i=1;i<) let uniq=name[4]+'_'+name[5]
uniq=uniq.replace('.csv','')
console.log(uniq)
// console.log(com.length)
for (let i=1;i<com.length;i++)
{
}
// console.log(com) // console.log(com)
// com = JSON.parse(com) // com = JSON.parse(com)
} }
......
let t='jCTVo1KpLd14YuLRiN_btc2&48&51.4&9_Buy' let t='220818102341_O1_BNC_BTCUSDT_Lp19500_22BTC13.csv'
console.log(t.length) t=t.split('_')
let uniq=t[4]+'_'+t[5]
t = t.replace(/_/g, '').replace(/Lp/g, '').replace(/BTC/g, '').replace(/ /g, '').replace(/btc2/g, '').replace(/btc3/g, '').replace(/btc4/g, '').replace(/&/g, '').replace(/btc/g, '').replace(/:/g, '') uniq=uniq.replace('.csv','')
t=removeDot(t) console.log(uniq)
console.log(t)
function removeDot(text)
{
let token=''
for (let i=0;i<text.length;i++)
if (text[i] !=='.' )
token=token+text[i]
return token
}
\ 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