Platform
Resources
Pricing
Sign in
Get started
Leo Orpilla III
Workspace
Fork
Public
By
Leo Orpilla III
Edited
Nov 19, 2023
2
Insert cell
Insert cell
Insert cell
foodDescriptions
=
{
const
raw
=
await
FileAttachment
(
"FOOD_DES.txt"
)
.
text
(
)
;
return
raw
.
split
(
/\r\n/
)
.
map
(
(
l
)
=>
l
.
split
(
"^"
)
)
.
filter
(
(
l
)
=>
l
.
length
==
14
)
.
map
(
(
l
)
=>
Object
.
fromEntries
(
l
.
map
(
(
x
,
i
)
=>
[
foodDescriptionFields
[
i
]
,
parseField
(
x
)
]
)
)
)
;
}
Insert cell
DOM
.
download
(
new
Blob
(
[
JSON
.
stringify
(
foodDescriptions
)
]
,
{
type
:
"application/json"
}
)
,
"SR28_foodDescriptions.json"
,
"Download Food Descriptions JSON"
)
Insert cell
Insert cell
foodWeights
=
{
const
raw
=
await
FileAttachment
(
"WEIGHT.txt"
)
.
text
(
)
;
return
raw
.
split
(
/\r\n/
)
.
map
(
(
l
)
=>
l
.
split
(
"^"
)
)
.
filter
(
(
l
)
=>
l
.
length
==
7
)
.
map
(
(
l
)
=>
Object
.
fromEntries
(
l
.
map
(
(
x
,
i
)
=>
[
foodWeightFields
[
i
]
,
parseField
(
x
)
]
)
)
)
;
}
Insert cell
DOM
.
download
(
new
Blob
(
[
JSON
.
stringify
(
foodWeights
)
]
,
{
type
:
"application/json"
}
)
,
"SR28_foodWeights.json"
,
"Download Food Weights JSON"
)
Insert cell
Insert cell
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
foodDescriptionFields
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
foodDescriptions
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
foodWeightFields
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
foodWeights
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
Edit
Add comment
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML
parseField
Edit
Add comment
Copy import
Select
Duplicate
Copy link
Embed
Delete
JavaScript
Markdown
HTML