MathGroup Archive 2006

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

Search the Archive

Re: Printing Lists to file without {}


On 4/28/06 at 6:32 AM, luisaph at terra.es (Luis) wrote:

>I can't use Export because I need to build a long file with
>different blocks, and Export doesn't allow to append things to an
>existing file.

>I could use it with CSV format if I could later append this to an
>existing file, but I don't know how to do it.

>And the expression Write[output,#]&/@ Take[ao,{1,100}] doesn't work
>neither.

>What I really need is something like a CSV format but that I can
>append to an existing file. It must be possible�¡�¡�¡ Anybody knows
>how?

I think the following does what you want

In[35]:=
data={{-9,8,3,1},{2,12,3,4},{-6,-9,-9,8}};
str=OpenWrite["temp.txt"];
WriteString[str,Sequence@@(StringTake[ToString@#,{2,-2}]<>"\n"&/@data)];
Close[str];

In[39]:=
!!temp.txt

From In[39]:=
-9, 8, 3, 1
2, 12, 3, 4
-6, -9, -9, 8
--
To reply via email subtract one hundred and four


  • Prev by Date: Re: nearest neighbor
  • Next by Date: Re: Image Processing
  • Previous by thread: Re: Printing Lists to file without {}
  • Next by thread: Re: Printing Lists to file without {}