Embedded data in a notebook

I'm looking for a method to store data which have been exported from an Excel sheet in my notebook. This enables my notenook to be indepent from the Excel sheet once the data have been imported.

In maple, i did like that :

FromExcel:= ExcelTools:-Import(File,Sheet, "A2:V27"):


and then i store the data in an ObjectTable

In mathematica, i can import data in my notebook with this code.

Import(path,{"Data",1,Line}])


Next, how can i store this data in my notebook ?

• I highly doubt you can import anything with Import("path",[Data,1,Line]). p.s. see Iconize. – Kuba May 16 '18 at 13:14
• sorry i quickly put the idea of the code – Bendesarts May 16 '18 at 13:16
• @Kuba i have corrected the code – Bendesarts May 16 '18 at 13:28
• I don't think so, please pay attention. Also, what about Iconize I've mentioned? – Kuba May 16 '18 at 13:28
• Iconize – user6014 May 16 '18 at 13:37

You can turn any output cell into an input cell. An example:

Range[10]


yields as output:

{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}


Edit that cell. Just put a name and an = in front of it, and maybe ; after to avoid seeing it repeated as output.

r10 = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};


In 11.3, this automatically promotes the output cell to input. I vaguely remember that in earlier versions you had to manually adjust cell properties.

So, now, you have a definition of r10 in your notebook, and you don't have to calculate (or import) it again.

With Mathematica 11.3 and later, you can conveniently store large expressions in a notebook using the new Iconize feature.

With Mathematica 11.2 and earlier, you can use my similar SaveToCell function. This blog post should also help in understanding why Iconize is useful (in case it's not clear).

What both do is allow large data (e.g. a million-element list) to be present in the notebook without occupying a lot of visual space.