Platform
Resources
Pricing
Sign in
Get started
Edward Misback
Live programming @ University of Washington
Workspace
Fork
Published
By
Edward Misback
Edited
Nov 23, 2020
6 forks
Importers
27 stars
Insert cell
Insert cell
Insert cell
xlsx
=
require
(
'https://bundle.run/xlsx@0.14.1'
)
Insert cell
viewof
binary
=
html
`<input type=file>`
Insert cell
input
=
new
Uint8Array
(
await
Files
.
buffer
(
binary
)
)
Insert cell
wb
=
xlsx
.
read
(
input
,
{
type
:
'array'
}
)
Insert cell
viewof
sheet_name
=
select
(
{
options
:
wb
.
SheetNames
,
title
:
'Sheet name'
}
)
Insert cell
ws
=
wb
.
Sheets
[
sheet_name
]
Insert cell
headers
=
Object
.
keys
(
xlsx
.
utils
.
sheet_to_json
(
wb
.
Sheets
[
sheet_name
]
)
[
0
]
)
Insert cell
as_json
=
xlsx
.
utils
.
sheet_to_json
(
ws
)
Insert cell
table
(
as_json
)
Insert cell
out_sheet
=
xlsx
.
utils
.
json_to_sheet
(
as_json
,
{
header
:
headers
}
)
Insert cell
write_sheet
=
out_sheet
=>
{
const
wb
=
xlsx
.
utils
.
book_new
(
)
xlsx
.
utils
.
book_append_sheet
(
wb
,
out_sheet
,
'output'
)
xlsx
.
writeFile
(
wb
,
'out.xlsx'
)
}
Insert cell
import
{
table
}
from
"@tmcw/tables"
Insert cell
import
{
checkbox
,
text
,
select
}
from
'@jashkenas/inputs'
Insert cell
Purpose-built for displays of data
Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Try it for free
Learn more
Fork
View
Export
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
xlsx
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
binary
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
input
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
wb
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
sheet_name
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
ws
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
headers
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
as_json
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
out_sheet
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
write_sheet
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML