Ric thanks very much for the script ammendments it works well.

-----Original Message-----
From: Sherlock, Ric [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 29 May 2007 1:34 PM
To: Programming forum
Subject: RE: [Jprogramming] CSV Output

Of course that 'x' in makecsv should be a 'y' like this :

makecsv=: 3 : 0
dat=. ,each 8!:2 each y
f=. '"'&,@(,&'",')@(#~ >:@(=&'"'))
dat=. f each dat
f=. <@(,&LF)@}:@;
dat=. ;f"1 dat
)

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Sherlock, Ric
> Sent: Tuesday, 29 May 2007 15:37
> To: Programming forum
> Subject: RE: [Jprogramming] CSV Output
> 
> Or maybe this would be better?
> 
> makecsv=: 3 : 0
> dat=. ,each 8!:2 each x
> f=. '"'&,@(,&'",')@(#~ >:@(=&'"'))
> dat=. f each dat
> f=. <@(,&LF)@}:@;
> dat=. ;f"1 dat
> )
> 
> writecsv=: 4 : 0
> dat=. makecsv x
> dat fwrites extcsv y
> )
> 
> appendcsv=: 4 : 0
> dat=. makecsv x
> dat fappends extcsv y
> )
> 
> > -----Original Message-----
> > From: [EMAIL PROTECTED] 
> > [mailto:[EMAIL PROTECTED] On Behalf Of 
> Sherlock, Ric
> > Sent: Tuesday, 29 May 2007 15:31
> > To: Programming forum
> > Subject: RE: [Jprogramming] CSV Output
> > 
> > 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: [EMAIL PROTECTED] 
> > > [mailto:[EMAIL PROTECTED] 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
> > > 
> > 
> ----------------------------------------------------------------------
> > For information about J forums see 
> http://www.jsoftware.com/forums.htm
> > 
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> 

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to