Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Parajuli
website
Commits
192f4c7f
Commit
192f4c7f
authored
Apr 30, 2021
by
Sini
Browse files
Update using the Recent ExcelSheet
parent
bc34e13e
Changes
3
Hide whitespace changes
Inline
Side-by-side
public/content/Citation
Sheet2.xlsx
→
public/content/CitationSheet2.xlsx
View file @
192f4c7f
File moved
public/content/CitationSheet3.xlsx
0 → 100644
View file @
192f4c7f
File added
public/js/citationSheetParse.js
View file @
192f4c7f
...
...
@@ -9,7 +9,7 @@ var bit1stAuthorLN ="";
/* set up XMLHttpRequest */
var
url
=
"
./content/CitationSheet.xlsx
"
;
var
url
=
"
./content/CitationSheet
3
.xlsx
"
;
var
xmlHttpRequest
=
new
XMLHttpRequest
();
xmlHttpRequest
.
open
(
"
GET
"
,
url
,
true
);
xmlHttpRequest
.
responseType
=
"
arraybuffer
"
;
...
...
@@ -33,9 +33,13 @@ xmlHttpRequest.onload = function (e) {
var
worksheet
=
workbook
.
Sheets
[
first_sheet_name
];
var
jsonOutput
=
XLSX
.
utils
.
sheet_to_json
(
worksheet
);
// console.log(jsonOutput);
for
(
i
=
0
;
i
<
jsonOutput
.
length
;
i
++
)
{
var
authors
=
jsonOutput
[
i
].
Authors
.
replace
(
"
and
"
,
""
).
trim
().
split
(
"
,
"
);
var
authors
;
if
(
jsonOutput
[
i
].
Authors
!=
undefined
){
authors
=
jsonOutput
[
i
].
Authors
.
replace
(
"
and
"
,
""
).
trim
().
split
(
"
,
"
);
}
var
bibAuthors
;
var
item
=
{
"
item
"
:
{
...
...
@@ -48,9 +52,21 @@ xmlHttpRequest.onload = function (e) {
"
name
"
:
"
journal
"
,
"
volume
"
:
""
,
"
year
"
:
""
,
"
month
"
:
""
,
"
pages
"
:
""
},
"
DOI
"
:
""
"
conference
"
:{
"
name
"
:
""
,
"
place
"
:
""
,
"
date
"
:
""
},
"
DOI
"
:
""
,
"
publisher
"
:
""
,
"
type
"
:
""
,
"
project
"
:
""
,
"
reviewed
"
:
""
,
"
open
"
:
""
},
"
links
"
:
{
"
pdf
"
:
""
,
...
...
@@ -107,11 +123,24 @@ xmlHttpRequest.onload = function (e) {
item
[
"
item
"
].
journal
.
name
=
jsonOutput
[
i
].
Journal
;
item
[
"
item
"
].
journal
.
volume
=
jsonOutput
[
i
].
Volume
;
item
[
"
item
"
].
journal
.
year
=
jsonOutput
[
i
].
Year
;
if
(
jsonOutput
[
i
].
Date
!=
undefined
){
item
[
"
item
"
].
journal
.
month
=
jsonOutput
[
i
].
Date
.
split
(
"
,
"
)[
0
].
trim
();
}
item
[
"
item
"
].
journal
.
pages
=
jsonOutput
[
i
].
Pages
;
item
[
"
item
"
].
conference
.
name
=
jsonOutput
[
i
].
Conference
;
item
[
"
item
"
].
conference
.
place
=
jsonOutput
[
i
][
"
City and Country
"
]
item
[
"
item
"
].
conference
.
date
=
jsonOutput
[
i
].
Date
;
item
[
"
item
"
].
publisher
=
jsonOutput
[
i
].
Publisher
;
item
[
"
item
"
].
type
=
jsonOutput
[
i
][
"
Type of Work
"
];
item
[
"
item
"
].
project
=
jsonOutput
[
i
].
Project
;
item
[
"
item
"
].
reviewed
=
jsonOutput
[
i
][
"
Peer-Reviewed
"
];
item
[
"
item
"
].
open
=
jsonOutput
[
i
][
"
Open Access
"
];
item
[
"
item
"
].
DOI
=
jsonOutput
[
i
].
DOI
;
item
[
"
links
"
].
pdf
=
jsonOutput
[
i
].
URL
;
item
[
"
links
"
].
pdf
=
jsonOutput
[
i
].
PDF_Link
;
item
[
"
links
"
].
url
=
jsonOutput
[
i
].
URL
;
item
[
"
links
"
].
demo
=
jsonOutput
[
i
].
URL
;
item
[
"
links
"
].
demo
=
jsonOutput
[
i
].
Demo
;
//// BibTex /////////////////////
item
[
"
bibtex
"
]
=
"
@article{
"
+
bit1stAuthorLN
+
jsonOutput
[
i
].
Year
+
"
,
"
+
...
...
@@ -119,7 +148,7 @@ xmlHttpRequest.onload = function (e) {
"
},author={
"
+
bibAuthors
.
trim
().
substring
(
0
,
bibAuthors
.
trim
().
lastIndexOf
(
"
"
))
+
"
},journal={
"
+
jsonOutput
[
i
].
Journal
+
"
},volume={
"
+
jsonOutput
[
i
].
Volume
+
// "},number={"+
n
umber
// "},number={"+
jsonOutput[i].N
umber
"
},pages={
"
+
jsonOutput
[
i
].
Pages
+
"
},year={
"
+
jsonOutput
[
i
].
Year
+
"
},DOI ={
"
+
jsonOutput
[
i
].
DOI
+
...
...
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