Re: Copying text out of mathematica
- To: mathgroup at smc.vnet.net
- Subject: [mg94162] Re: Copying text out of mathematica
- From: Mariano Suárez-Alvarez <mariano.suarezalvarez at gmail.com>
- Date: Sat, 6 Dec 2008 06:14:33 -0500 (EST)
- References: <ghb00f$og3$1@smc.vnet.net>
On Dec 5, 8:32 am, John Fultz <jfu... at wolfram.com> wrote: > On Wed, 3 Dec 2008 05:44:17 -0500 (EST), car... at colorado.edu wrote: > > On Dec 1, 10:30 pm, John Fultz <jfu... at wolfram.com> wrote: > > >> On Mon, 1 Dec 2008 07:01:25 -0500 (EST), Mariano Su=E1rez-Alvarez wr= ote: > >>> Hi all, > > >>> this is probably silly, but anyways... How do I copy text out of > >>> Mathematica (6.0.3, Linux) as plain text without the really, really > >>> annoying \ characters that Mathematica adds to mark line breaks? > >>> How does one control the line-length used by InputForm, for example, > >>> when doing things like > > >>> InputForm@ StringJoin@ Table["a", {160}] > > >>> Cheers, > > >>> -- m > > >> By default, copying Input or Output cells from Mathematica goes to a > >> great deal of trouble to preserve evaluation properties. But to sim= ply > >> copy what you see, just do Copy As->Plain Text. Copying this way ha= s an > >> infinite width, incidentally...so the only line breaks which will be > >> copied are those which are explicitly in the thing you copied. > > >> Copy As Plain Text also has a keyboard shortcut, Ctrl+Shift+C (or > >> Cmd+Shift+C on the Mac). > > >> Sincerely, > > >> John Fultz > >> jfu... at wolfram.com > >> User Interface Group > >> Wolfram Research, Inc. > > > Selecting the InputForm output with the mouse then > > doing CopyAs->PlainText preserves the same unwanted > > linefeeds and spaces inserted by InputForm. > > Yes, I wasn't paying close attention here. The original question sugge= sts it's > a copy/paste problem, but copy/paste is, in this case, faithfully represe= nting > the output...so the first question ought to be, how do I get InputForm to > produce something without backslashes and newlines? > > To which the answer is this... > > SetOptions["stdout", PageWidth -> Infinity]; > InputForm@StringJoin@Table["a", {160}] Ah! That's precisely what I was looking for. Now, I would have *never* have thought of changing options to stdout to do that, mostly because the output in this case is certainly not going to stdout! Thanks. -- m