来自 Mathematica 的 file.nb 在 GitHub 上有一个奇怪的格式
file.nb from Mathematica has a strange format on GitHub
我想下载一个扩展名为 .nb 的文件,该文件已上传到 GitHub 存储库。但是,它有一种奇怪的格式,我无法绕过它并像原来那样使用它。这是它的外观示例:
(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)
(* CreatedBy='Mathematica 7.0' *)
(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[ 145, 7]
NotebookDataLength[ 1053158, 18799]
NotebookOptionsPosition[ 1043705, 18664]
NotebookOutlinePosition[ 1044264, 18683]
CellTagsIndexPosition[ 1044221, 18680]
WindowFrame->Normal*)
(* Beginning of Notebook Content *)
Notebook[{
Cell[BoxData[
RowBox[{"(*",
RowBox[{"Import", " ", "data", " ", "from", " ",
RowBox[{"the", " ", ".", "csv"}]}], "*)"}]], "Input",
CellChangeTimes->{{3.8325121403603525\`*^9, 3.832512162342577*^9},
3.8338276384526296`*^9},
FontFamily->"Consolas",
FontWeight->"Normal",ExpressionUUID->"6e20bfb1-78fc-454a-85f3-fab3e1e1f609"],
Cell[BoxData[
RowBox[{
RowBox[{"s", "=",
RowBox[{
"Import", "[", "\"\<C:\\Users\\User\\Desktop\\data02.csv\>\"",
"]"}]}], ";"}]], "Input",
CellChangeTimes->{{3.831030550939706*^9, 3.831030563133726*^9}, {
3.83103080712603*^9, 3.8310308583911963\`*^9}, {3.8310332771328163\`*^9,
3.831033277194804*^9}, {3.8310363192249303\`*^9, 3.831036327345213*^9}, {
3.83330485714029*^9, 3.8333048619195776\`*^9}, 3.833829927653514*^9, {
3.833833840478625*^9, 3.833833846148329*^9}},
FontFamily->"Consolas",
FontWeight->"Bold",ExpressionUUID->"4af89285-72de-4b68-b0f1-ffa673886bec"],
(...)
我查看了此示例中存在的 link,但找不到任何有用的信息。
我应该怎么做才能恢复它的初始状态。换句话说,如何复用它已有的功能和内容?
这看起来像是 Mathematica 笔记本的正常底层代码。如果您将代码复制到纯文本编辑器中并使用扩展名 .nb 保存它,它应该可以在 Mathematica 中正常打开。
我想下载一个扩展名为 .nb 的文件,该文件已上传到 GitHub 存储库。但是,它有一种奇怪的格式,我无法绕过它并像原来那样使用它。这是它的外观示例:
(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)
(* CreatedBy='Mathematica 7.0' *)
(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[ 145, 7]
NotebookDataLength[ 1053158, 18799]
NotebookOptionsPosition[ 1043705, 18664]
NotebookOutlinePosition[ 1044264, 18683]
CellTagsIndexPosition[ 1044221, 18680]
WindowFrame->Normal*)
(* Beginning of Notebook Content *)
Notebook[{
Cell[BoxData[
RowBox[{"(*",
RowBox[{"Import", " ", "data", " ", "from", " ",
RowBox[{"the", " ", ".", "csv"}]}], "*)"}]], "Input",
CellChangeTimes->{{3.8325121403603525\`*^9, 3.832512162342577*^9},
3.8338276384526296`*^9},
FontFamily->"Consolas",
FontWeight->"Normal",ExpressionUUID->"6e20bfb1-78fc-454a-85f3-fab3e1e1f609"],
Cell[BoxData[
RowBox[{
RowBox[{"s", "=",
RowBox[{
"Import", "[", "\"\<C:\\Users\\User\\Desktop\\data02.csv\>\"",
"]"}]}], ";"}]], "Input",
CellChangeTimes->{{3.831030550939706*^9, 3.831030563133726*^9}, {
3.83103080712603*^9, 3.8310308583911963\`*^9}, {3.8310332771328163\`*^9,
3.831033277194804*^9}, {3.8310363192249303\`*^9, 3.831036327345213*^9}, {
3.83330485714029*^9, 3.8333048619195776\`*^9}, 3.833829927653514*^9, {
3.833833840478625*^9, 3.833833846148329*^9}},
FontFamily->"Consolas",
FontWeight->"Bold",ExpressionUUID->"4af89285-72de-4b68-b0f1-ffa673886bec"],
(...)
我查看了此示例中存在的 link,但找不到任何有用的信息。
我应该怎么做才能恢复它的初始状态。换句话说,如何复用它已有的功能和内容?
这看起来像是 Mathematica 笔记本的正常底层代码。如果您将代码复制到纯文本编辑器中并使用扩展名 .nb 保存它,它应该可以在 Mathematica 中正常打开。