MathGroup Archive 2009

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

Search the Archive

Re: Exporting data into a file, OpenWrite

  • To: mathgroup at smc.vnet.net
  • Subject: [mg96879] Re: Exporting data into a file, OpenWrite
  • From: Albert Retey <awnl at gmx-topmail.de>
  • Date: Thu, 26 Feb 2009 07:59:59 -0500 (EST)
  • References: <gnq6s2$87n$1@smc.vnet.net> <200902241044.FAA23505@smc.vnet.net> <go31el$f78$1@smc.vnet.net>

peter wrote:
> no double-slashes for me thank you very much - I've got a Mac.
> 
> 2009/2/24 Sjoerd C. de Vries <sjoerd.c.devries at gmail.com>:
>> Bill Rowe wrote
>>
>>> When you use Export, the file will be created in the current
>>> working directory.
>> I might add "...unless you include the full path to the file in the
>> filename (using double slashes to separate directories and files, as a
>> slash is used as an escape character in strings)"
>>
>> Cheers -- Sjoerd

I think correctly you would call the character that you need to use on
Windows a backslash (\) and that's the one you need to escape, because
it is the escape character in Mathematica. On other systems you will
need other characters for separating directories in pathes, which one is
 held in the variable $PathnameSeparator. AFAIK on Windows in many
places within Mathematica a single slash (/) will also work as a
pathname separator in filenames. Probably you shouldn't rely on that but
it's more convenient than the double backslash sometimes.

An even better approach is to construct the filename with the function
ToFileName, starting with one of the predefined directory variables you
can find with

Information["$*Directory*"]


hth,

albert


  • Prev by Date: Re: Map and functional constructs to replace iterative statements
  • Next by Date: Re: Map and functional constructs to replace iterative statements
  • Previous by thread: Re: Exporting data into a file, OpenWrite
  • Next by thread: Re: Re: Exporting data into a file, OpenWrite