Toggle navigation
Toggle navigation
This project
Loading...
Sign in
신원형
/
study-or-enjoy
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
김연우
2022-06-05 20:53:30 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
35d4e5061737a25bdf8479c9555ce10064b6fa73
35d4e506
1 parent
132cedc4
modify read_csv
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
37 deletions
read_csv.js
read_csv.js
View file @
35d4e50
...
...
@@ -129,44 +129,10 @@ app.post('/hook', function (req, res) {
}
res
.
sendStatus
(
200
);
chooseFile
=
function
()
{
if
(
destCar
==
"cafe"
)
{
fs
.
createReadStream
(
'cafe_list.csv'
)
.
pipe
(
csv
())
.
on
(
'data'
,
(
data
)
=>
results
.
push
(
data
))
.
on
(
'end'
,
()
=>
{
console
.
log
(
results
);
});
}
else
if
(
destCar
==
"meal"
)
{
fs
.
createReadStream
(
'meal_list.csv'
)
.
pipe
(
csv
())
.
on
(
'data'
,
(
data
)
=>
results
.
push
(
data
))
.
on
(
'end'
,
()
=>
{
console
.
log
(
results
);
});
}
else
if
(
destCar
==
"play"
)
{
fs
.
createReadStream
(
'play_list.csv'
)
.
pipe
(
csv
())
.
on
(
'data'
,
(
data
)
=>
results
.
push
(
data
))
.
on
(
'end'
,
()
=>
{
console
.
log
(
results
);
});
}
else
if
(
destCar
==
"bar"
)
{
fs
.
createReadStream
(
'bar_list.csv'
)
.
pipe
(
csv
())
.
on
(
'data'
,
(
data
)
=>
results
.
push
(
data
))
.
on
(
'end'
,
()
=>
{
console
.
log
(
results
);
});
}
}
chooseFile
();
chooseFile
();
});
try
{
...
...
@@ -186,3 +152,38 @@ try {
const
csv
=
require
(
'csv-parser'
)
const
results
=
[];
chooseFile
=
function
()
{
if
(
destCar
==
"cafe"
)
{
fs
.
createReadStream
(
'cafe_list.csv'
)
.
pipe
(
csv
())
.
on
(
'data'
,
(
data
)
=>
results
.
push
(
data
))
.
on
(
'end'
,
()
=>
{
console
.
log
(
results
);
});
}
else
if
(
destCar
==
"meal"
)
{
fs
.
createReadStream
(
'meal_list.csv'
)
.
pipe
(
csv
())
.
on
(
'data'
,
(
data
)
=>
results
.
push
(
data
))
.
on
(
'end'
,
()
=>
{
console
.
log
(
results
);
});
}
else
if
(
destCar
==
"play"
)
{
fs
.
createReadStream
(
'play_list.csv'
)
.
pipe
(
csv
())
.
on
(
'data'
,
(
data
)
=>
results
.
push
(
data
))
.
on
(
'end'
,
()
=>
{
console
.
log
(
results
);
});
}
else
if
(
destCar
==
"bar"
)
{
fs
.
createReadStream
(
'bar_list.csv'
)
.
pipe
(
csv
())
.
on
(
'data'
,
(
data
)
=>
results
.
push
(
data
))
.
on
(
'end'
,
()
=>
{
console
.
log
(
results
);
});
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment