Re: chunk-file function

2008-11-14 Thread Mark H.
On Nov 12, 2:20 pm, "Brian Doyle" <[EMAIL PROTECTED]> wrote: > I had to process each line of a very large file, 120MB, > and did not want to read in the whole file at once.   I > wrote this function, chunk-file, that allows me to pass > in a function and args that will process each line. What hap

Re: chunk-file function

2008-11-12 Thread Brian Doyle
I did try the line-seq and it didn't run out of memory and I used a surrounding with-open and it works great now. Thanks Stephen! On Wed, Nov 12, 2008 at 4:14 PM, Brian Doyle <[EMAIL PROTECTED]> wrote: > In your example using line-seq, should really surround it with the > with-open function so

Re: chunk-file function

2008-11-12 Thread Brian Doyle
In your example using line-seq, should really surround it with the with-open function so that it will close the reader? Thanks. On Wed, Nov 12, 2008 at 4:02 PM, Stephen C. Gilardi <[EMAIL PROTECTED]>wrote: > > > On Nov 12, 2008, at 5:20 PM, Brian Doyle wrote: > > > It works great for me, but ho

Re: chunk-file function

2008-11-12 Thread Stephen C. Gilardi
On Nov 12, 2008, at 5:20 PM, Brian Doyle wrote: > It works great for me, but hoping to get any feedback > about coding style or there is already something out > there that does such a thing or whatever. Thanks. > > (defn chunk-file > "Takes a file, number of lines, a function and args. >

chunk-file function

2008-11-12 Thread Brian Doyle
I had to process each line of a very large file, 120MB, and did not want to read in the whole file at once. I wrote this function, chunk-file, that allows me to pass in a function and args that will process each line. It works great for me, but hoping to get any feedback about coding style or the