Services & Resources / Wolfram Forums / MathGroup Archive

MathGroup Archive 2013

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

Search the Archive

Re: a trivial task?

  • To: mathgroup at
  • Subject: [mg131115] Re: a trivial task?
  • From: Helen Read <readhpr at>
  • Date: Wed, 12 Jun 2013 05:39:12 -0400 (EDT)
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:
  • Delivered-to:
  • References: <kp6fm8$nct$>

First, fix the unmatched quotes in the last part of exp.

exp = {"I do not", "understand", "this"}

Use Riffle to insert a linebreak in between each part, and then use 
StringJoin to combine into a single string.

withbreaks=Riffle[exp, "\n"]


Export["filename.txt", text]

I like to use SetDirectory[NotebookDirectory[]]
before importing/exporting, so that the directory is the same place 
where the working notebook is saved.

On 6/11/2013 2:22 AM, Francisco Gutierrez wrote:
> Friends:
> Suppose I have a string variable, say:exp={"I do not", "understand", this"}
> I want to export this variable to a text file, so that each part of exp is separated by a line (\n). Thus I want to get:I do notunderstandthis
> How can I achieve this? Thanks
> Francisco

  • Prev by Date: Re: problems with FrameTicks
  • Next by Date: Re: problems with FrameTicks
  • Previous by thread: Re: a trivial task?
  • Next by thread: Re: Re: a trivial task?