MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: Copying text out of mathematica

  • To: mathgroup at smc.vnet.net
  • Subject: [mg94124] Re: [mg94053] Re: Copying text out of mathematica
  • From: John Fultz <jfultz at wolfram.com>
  • Date: Fri, 5 Dec 2008 05:32:45 -0500 (EST)
  • Reply-to: jfultz at wolfram.com

On Wed, 3 Dec 2008 05:44:17 -0500 (EST), carlos 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 wrote:
>>> 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 simply
>> copy what you see, just do Copy As->Plain Text.  Copying this way has 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 suggests it's 
a copy/paste problem, but copy/paste is, in this case, faithfully representing 
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}]


Sincerely,
 
John Fultz
jfultz at wolfram.com
User Interface Group
Wolfram Research, Inc.




  • Prev by Date: Re: Rearranging expressions in a user-defined form
  • Next by Date: Re: Clever Tricky Solutions
  • Previous by thread: Re: Copying text out of mathematica
  • Next by thread: Re: Re: Copying text out of mathematica