[Jprogramming] CSV Output
Sherlock, Ric
R.G.Sherlock at massey.ac.nz
Tue May 29 11:30:33 HKT 2007
My first reaction would be to replace the 'fwrites' verb in the last
line of 'writecsv' with 'fappends'.
Maybe there is the case for adding an extra verb ('appendcsv') to the
csv script?
writecsv=: 4 : 0
dat=. ,each 8!:2 each x
f=. '"'&,@(,&'",')@(#~ >:@(=&'"'))
dat=. f each dat
f=. <@(,&LF)@}:@;
dat=. ;f"1 dat
dat fwrites extcsv y
)
appendcsv=: 4 : 0
dat=. ,each 8!:2 each x
f=. '"'&,@(,&'",')@(#~ >:@(=&'"'))
dat=. f each dat
f=. <@(,&LF)@}:@;
dat=. ;f"1 dat
dat fappends extcsv y
)
> -----Original Message-----
> From: programming-bounces at jsoftware.com
> [mailto:programming-bounces at jsoftware.com] On Behalf Of
> Saunders, John (TQEH)
> Sent: Tuesday, 29 May 2007 15:13
> To: Programming forum
> Subject: [Jprogramming] CSV Output
>
> Hi Everyone - I have a boxed array I am writing to a csv file
> using the writecsv verb from the csv script, I run out of
> memory when I write the whole array so I've been writing
> chunks of it to different output files; is there a way for me
> to append the output to an existing file?
>
> Many thanks
> John Saunders
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
More information about the Programming
mailing list