Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ai
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
ai
Commits
61951ea0
Commit
61951ea0
authored
Aug 25, 2022
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git pull
parent
2867ad15
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
37 deletions
+34
-37
merge.js
merge.js
+34
-37
No files found.
merge.js
View file @
61951ea0
...
@@ -2,7 +2,7 @@ const fs = require('fs')
...
@@ -2,7 +2,7 @@ const fs = require('fs')
let
moment
=
require
(
'
moment-timezone
'
)
let
moment
=
require
(
'
moment-timezone
'
)
let
_
=
require
(
'
lodash
'
)
let
_
=
require
(
'
lodash
'
)
const
uuid
=
require
(
'
uniqid
'
)
const
uuid
=
require
(
'
uniqid
'
)
let
all
=
[]
let
all
=
[]
init
()
init
()
...
@@ -24,13 +24,13 @@ async function init() {
...
@@ -24,13 +24,13 @@ async function init() {
arr
.
push
(
read
(
'
E:
\\
fail
\\
btc8
\\
'
+
files2
[
i
],
files2
[
i
]))
arr
.
push
(
read
(
'
E:
\\
fail
\\
btc8
\\
'
+
files2
[
i
],
files2
[
i
]))
}
}
arr
=
await
Promise
.
all
(
arr
)
arr
=
await
Promise
.
all
(
arr
)
// console.log(arr)
// console.log(arr)
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
for
(
let
i
=
0
;
i
<
arr
.
length
;
i
++
)
arrange
(
arr
[
i
])
arrange
(
arr
[
i
])
// console.log(arr[0].arr[0])
// console.log(arr[0].arr[0])
manage
()
manage
()
// console.log(all)
// console.log(all)
// console.log(files)
// console.log(files)
// let com = await fs.readFileSync('E:\\fail\\btc1', 'utf8');
// let com = await fs.readFileSync('E:\\fail\\btc1', 'utf8');
...
@@ -39,45 +39,42 @@ manage()
...
@@ -39,45 +39,42 @@ manage()
}
}
function
manage
()
function
manage
()
{
{
for
(
let
i
=
0
;
i
<
all
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
all
.
length
;
i
++
)
let
data
=
all
[
i
].
data
{
data
=
_
.
uniqBy
(
data
,
'
time
'
);
let
data
=
all
[
i
].
data
data
=
_
.
orderBy
(
data
,
'
time
'
);
data
=
_
.
uniqBy
(
data
,
'
time
'
);
let
t
=
''
data
=
_
.
orderBy
(
data
,
'
time
'
);
for
(
let
z
=
0
;
z
<
data
.
length
;
z
++
)
{
let
s
=
data
[
z
].
data
// let s=data.data.arr
for
(
let
j
=
0
;
j
<
s
.
length
;
j
++
)
// for (let j=0;j<s.length;j++)
{
// {
let
t
=
(
j
+
1
)
+
'
,
'
+
s
[
1
]
+
'
,
'
+
s
[
2
]
+
'
,
'
+
s
[
3
]
+
'
,
'
+
s
[
4
]
+
'
,
'
+
s
[
5
]
+
'
,
'
+
s
[
6
]
+
'
,
'
+
s
[
7
]
+
'
,
'
+
s
[
8
]
+
'
,
'
+
s
[
9
]
// let t=(j+1)+','+s[1]+','+s[2]+','+s[3]+','+s[4]+','+s[5]+','+s[6]+','+s[7]+','+s[8]+','+s[9]
data
[
z
].
text
=
t
// data.text=t
}
// }
}
console
.
log
(
data
)
all
[
i
].
data
=
data
console
.
log
(
data
)
all
[
i
].
data
=
data
}
}
}
}
async
function
arrange
(
data
)
async
function
arrange
(
data
)
{
{
for
(
let
i
=
0
;
i
<
all
.
length
;
i
++
)
for
(
let
i
=
0
;
i
<
all
.
length
;
i
++
)
if
(
all
[
i
].
uniq
===
data
.
uniq
)
{
if
(
all
[
i
].
uniq
===
data
.
uniq
)
{
for
(
let
j
=
0
;
j
<
data
.
arr
.
length
;
j
++
)
for
(
let
j
=
0
;
j
<
data
.
arr
.
length
;
j
++
)
all
[
i
].
data
.
push
(
data
.
arr
[
j
])
all
[
i
].
data
.
push
(
data
.
arr
[
j
])
return
return
}
}
all
.
push
({
uniq
:
data
.
uniq
,
data
:
data
.
arr
})
all
.
push
({
uniq
:
data
.
uniq
,
data
:
data
.
arr
})
}
}
async
function
read
(
dir
,
name
)
{
async
function
read
(
dir
,
name
)
{
let
arr
=
[]
let
arr
=
[]
let
com
=
await
fs
.
readFileSync
(
dir
,
'
utf8
'
);
let
com
=
await
fs
.
readFileSync
(
dir
,
'
utf8
'
);
...
@@ -91,15 +88,15 @@ async function read(dir, name) {
...
@@ -91,15 +88,15 @@ async function read(dir, name) {
let
pars
=
com
[
i
].
split
(
'
,
'
)
let
pars
=
com
[
i
].
split
(
'
,
'
)
let
obj
=
{}
let
obj
=
{}
obj
.
time
=
pars
[
1
]
obj
.
time
=
pars
[
1
]
if
(
typeof
obj
.
time
===
"
undefined
"
)
if
(
typeof
obj
.
time
===
"
undefined
"
)
continue
continue
obj
.
data
=
pars
obj
.
data
=
pars
arr
.
push
(
obj
)
arr
.
push
(
obj
)
}
}
// console.log(uniq,arr)
// console.log(uniq,arr)
return
{
uniq
,
arr
}
return
{
uniq
,
arr
}
// console.log(com)
// console.log(com)
// com = JSON.parse(com)
// com = JSON.parse(com)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment