Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1999
*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 1999

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

Search the Archive

Re: writing mathematica data to a tab delimited file??

  • To: mathgroup at smc.vnet.net
  • Subject: [mg18342] Re: writing mathematica data to a tab delimited file??
  • From: "Atul Sharma" <mdsa at musica.mcgill.ca>
  • Date: Wed, 30 Jun 1999 14:13:16 -0400
  • References: <7l5t26$il6@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

It's not very elegant (a product of my first attempts to use Mathematica a
few years back, sorry), but it has been doing the job of writing tab
delimited files for me ever since. Just specify the list to be saved and the
path&name of the new file as arguments to writeOutput[ ].

A. Sharma

writeOutput[outputList_?ListQ,saveName_?StringQ]:=Module[{lineout,wstrm},

wstrm=OpenAppend[saveName<>".txt"];
lineout="\n";
Do[
lineout=lineout<>ToString[outputList[[i]],FormatType->OutputForm]<>Tab,
{i,1,Length[outputList]}];

WriteString[wstrm,lineout];
Close[wstrm];
];


Mike wrote in message <7l5t26$il6 at smc.vnet.net>...
>
>I frequently read data into mathematica that has been given to me as a
>two column tab delimited text file.  Is their some way of saving a
>mathematica list eg.
>
>mylist=Table[{1, x}, {x, 1, 10, 1}]
>
>
>as a file in a tab delimited two column format
>
>1 1
>1 2
>1 3
>1 4
>
>etc.
>
>
>
>to be read by other people in eg. excel or sigma plot?
>
>thanks
>
>Mike
>




  • Prev by Date: HOW BEST?: Mathematica figs -> Textures on Mac -> PDF
  • Next by Date: Memory leak in function using dynamic programming
  • Previous by thread: Re: writing mathematica data to a tab delimited file??
  • Next by thread: Re: writing mathematica data to a tab delimited file??