Toggle navigation
Toggle navigation
This project
Loading...
Sign in
이나경
/
time_table
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
곽병민
2022-06-02 22:05:58 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1768b23cbd969681ee73f0dc1ac8247254cda0e3
1768b23c
1 parent
516738d0
Test read excel file
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
excelread.js
excelread.js
0 → 100644
View file @
1768b23
// @breif xlsx 모듈추출
const
xlsx
=
require
(
"xlsx"
);
// @files 엑셀 파일을 가져온다.
const
excelFile
=
xlsx
.
readFile
(
"컴퓨터공학과 권장이수 가이드라인.xlsx"
);
// @breif 엑셀 파일의 첫번째 시트의 정보를 추출
const
sheetName
=
excelFile
.
SheetNames
[
0
];
// @details 첫번째 시트 정보 추출
const
firstSheet
=
excelFile
.
Sheets
[
sheetName
];
// @details 시트의 제목 추출
// @details 엑셀 파일의 첫번째 시트를 읽어온다.
const
jsonData
=
xlsx
.
utils
.
sheet_to_json
(
firstSheet
,
{
defval
:
""
}
);
console
.
log
(
jsonData
);
var
ary
=
[];
const
xlsxFile
=
require
(
'read-excel-file/node'
);
xlsxFile
(
'컴퓨터공학과 권장이수 가이드라인.xlsx'
).
then
((
rows
)
=>
{
//console.log(rows); console.table(rows);
for
(
var
i
in
rows
)
{
ary
.
push
(
rows
[
i
]);
}
//console.log(ary)
})
console
.
log
(
ary
);
\ No newline at end of file
Please
register
or
login
to post a comment