This question already has an answer here:

So, an input cell after evaluation gives an

In[X] := str1 = ...
Out[X]:= ....

If I right click on the right edge of the Out[X]'s cell, and select Copy As > Plain text in the context menu, and then open a new text file in Emacs and paste it in. Then I use str2 = Import[file, "String"]. What is the difference between str1 and str2? How do I get str2 without using an external file?


marked as duplicate by Kuba, RunnyKine, Yves Klett, MarcoB, user9660 Apr 8 '16 at 15:42

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • $\begingroup$ You could try using ExportString[] along with InputForm[]. $\endgroup$ – J. M. will be back soon Apr 1 '16 at 2:44
  • $\begingroup$ Do you mean InputForm[ExportString[str1]] === str2 is True? If not, what do you mean exactly? $\endgroup$ – qazwsx Apr 1 '16 at 3:51
  • $\begingroup$ I was in the suspicion that Copy As > Plain text calls some FrontEnd function and is not always same as using some combination of kernel functions. $\endgroup$ – qazwsx Apr 1 '16 at 3:52
  • 4
    $\begingroup$ Is that what you are after? mathematica.stackexchange.com/q/1319/5478 $\endgroup$ – Kuba Apr 1 '16 at 6:20

Browse other questions tagged or ask your own question.