MathGroup Archive 2003

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

Search the Archive

Re: export some data to a specified file?

  • To: mathgroup at
  • Subject: [mg39745] Re: [mg39685] export some data to a specified file?
  • From: Dale Horton <daleh at>
  • Date: Wed, 5 Mar 2003 00:05:03 -0500 (EST)
  • Sender: owner-wri-mathgroup at

At 09:04 PM 3/1/2003, liwen liwen wrote:

>I want to export some data to a specified file, for instance,
>Spring.txt, I use 'FileName ' as the local file name.
>     But the function I develop only export the data to a file named
>'FileName'but not Spring.txt.
>     How can I achieve this?
>       Thanks.
>     Liwen
>       (DataToBeExport>>FileName);];

The >> is parsed in a special way. To allow people to use it without 
quoting the filename, the filename isn't evaluated but turned directly into 
a string. To avoid that behavior, you can use the FullForm of the same command.

ExportDatas[FileName_,DataToBeExport_] :=
Put[DataToBeExport, FileName]


Or you could just use Export

Export["Spring.txt", DataToBeExport, "Expression"]


  • Prev by Date: Re: debug compiled function
  • Next by Date: Re: Is Sort stable?
  • Previous by thread: export some data to a specified file?
  • Next by thread: Incrementing a "For" loop - "For loop.nb" 5893 Bytes yEnc