1
$\begingroup$

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.

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

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.

$\endgroup$
2
$\begingroup$

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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.