MathGroup Archive 2009

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

Search the Archive

Re: Remove quotes from Cell Expression

  • To: mathgroup at smc.vnet.net
  • Subject: [mg99530] Re: [mg99473] Remove quotes from Cell Expression
  • From: John Fultz <jfultz at wolfram.com>
  • Date: Thu, 7 May 2009 06:36:24 -0400 (EDT)
  • Reply-to: jfultz at wolfram.com

On Wed, 6 May 2009 05:26:11 -0400 (EDT), robert prince-wright wrote:
>
>
> Can someone show me how to write the list m1 to a notebook without the
> quotes showing?
>
> m1 = {{"a",b},{c,d}};
> nb = CreateDocument[];
> NotebookWrite[nb, Cell[ToBoxes@Grid[m1],"Text"]]
>
> The expression below gives the right result so there is something missing
> in my limited understanding of Cell expressions.
>
> Grid@m1
>
>
> Thanks
> Robert

Actually, Grid@m1 *does* create something with quotes.  They're just hidden by 
virtue of the fact that the "Output" style has ShowStringCharacters->False set.  
To see this, evaluate Grid@m1, then click in the cell and type a character. 
This auto-converts the cell into an Input cell, and the quotes will pop back
into existence.

If this kind of solution is satisfactory to you, then the only thing you have to 
change is...

NotebookWrite[nb, Cell[ToBoxes@Grid[m1],"Text", ShowStringCharacters->False]]

However, if there are quotes you did want to see, and they don't show up inside 
of a string (e.g. "a quote -> \" <-"), then this will cause problems.

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





  • Prev by Date: Re: Reading csv with ;
  • Next by Date: Odd ordering of results?
  • Previous by thread: Re: Remove quotes from Cell Expression
  • Next by thread: Re: Remove quotes from Cell Expression