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 >