1

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 ?

Thank you for your help.

Bendesarts
  • 1,099
  • 5
  • 12

2 Answers2

2

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.

John Doty
  • 13,712
  • 1
  • 22
  • 42
2

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.

Szabolcs
  • 234,956
  • 30
  • 623
  • 1,263