Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

Re: Writing strings

  • To: mathgroup at smc.vnet.net
  • Subject: [mg49237] Re: [mg49232] Writing strings
  • From: Sseziwa Mukasa <mukasa at jeol.com>
  • Date: Fri, 9 Jul 2004 02:26:08 -0400 (EDT)
  • References: <200407080651.CAA04115@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

On Jul 8, 2004, at 2:51 AM, camartin at snet.net wrote:

> Group,
>
> Why is it when I write a list of strings to a file, then try to read it
> back later, the list has only one element per line?

Because Write writes all the expressions onto one line as described by 
help unless you include new lines explicitly in the list of 
expressions.

> g= {"some string", "another sttring"}
> rat=OpenAppend["c:\file"]
> Write[rat, g]
> Close[rat]
>

Use Write[rat,#]&/@g.  This will produce your desired results.

Regards,

Ssezi


  • Prev by Date: Re: DOES MATHEMATICA CHANGE THE SYNTAX EACH NEW RELEASE?
  • Next by Date: Re: How to plot the surface of revolution graphics
  • Previous by thread: Writing strings
  • Next by thread: Re: Writing strings