0
$\begingroup$

Hi I am very new to Mathematica.

I wanted to ask how can I copy the outputs (Out) data from Mathematica.

I have results in this format

Out[1]    12.9
Out[2]    13.6
Out[3]    7.2 

I want to copy 12.9; 13.6; 7.2; to a text document with delimiters

thanks

$\endgroup$
2
  • 1
    $\begingroup$ Hi, and welcome to Mathematica.SE, please consider taking the tour. Do you want to use the clipboard (Copy&Paste) or do you want to Export into a file directly? Its not very clear what do you need, consider editing your question to improve it, including your code that is generating the output you want to copy. $\endgroup$
    – rhermans
    Commented Oct 4, 2014 at 11:15
  • 1
    $\begingroup$ Would be easier to work with input instead of output, can you provide the code producing these numbers? $\endgroup$
    – Öskå
    Commented Oct 4, 2014 at 11:29

1 Answer 1

1
$\begingroup$

Something like...

Export["C:\\Temp\\Out.txt",StringJoin[Riffle[Map[ToString[Out[#]]&,{1,2,3}],";"]]]

I'd suggest you look up each of Export, StringJoin, Riffle, Map, ToString etc to work out what does what.

$\endgroup$
2
  • $\begingroup$ Notice that that solution is specific for Out[1],Out[2],Out[3], and will not always work. $\endgroup$
    – rhermans
    Commented Oct 4, 2014 at 11:21
  • 1
    $\begingroup$ True, but it is what the OP asked and I was hoping it would provide enough meat for some further manual reading. $\endgroup$
    – Ymareth
    Commented Oct 5, 2014 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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