# Changing Wolfram command line output into copyable text

I generated a long polynomial using the Wolfram command line, with divisions and exponents. But the divisions look like this:

4
-
5


And the exponents are on a different line:

  -6
10


And I need to copy the output to GeoGebra, so I need to have the output format like this:

4/5


And:

10^-6


How can I do this?

• Try wrapping your expression in InputForm
– shrx
Jul 28 '14 at 10:28
• @shrx Thanks, that worked! Jul 28 '14 at 10:29
• @shrx I just noticed that it gave 3.932502727915577*^-9*x^9. There should be a 10 between the * and the ^ chars, but there isn't and now I have to manually add it. Is there a way to add this 10 automatically? Jul 28 '14 at 10:37
• See reference.wolfram.com/language/guide/Syntax.html, and look for "scientific notation"; also reference.wolfram.com/language/tutorial/… might be helpful. Jul 28 '14 at 10:50

By default in the terminal interface expressions are printed in OutputForm:

OutputForm is an approximation to StandardForm which uses only ordinary keyboard characters.

As you observe this multi-line pseudo-2D output cannot (easily) be used as input.
InputForm formats expressions in a way that can be input to Mathematica:

InputForm always produces one-dimensional output, suitable to be typed as lines of Wolfram Language input.

However there is absolutely no certainty that this output can be used unmodified as input to other applications. This is why you see e.g. 1.234*^-9 -- that is valid Mathematica syntax.

There is no output format which is both compatible with other applications and which is capable of handling all expression types, so you will need to specify more clearly the output you are creating and the application that it is for. Some possibly useful functions: FortranForm, CForm, ExportString.

• Thanks for your answer! I updated my question by adding that GeoGebra is the program that I need it for. Jul 28 '14 at 11:20