Re: reading a range from a large file

2009-10-27 Thread Roberto Mannai
setLineNumber should not skip lines (at least officially - see http://java.sun.com/j2se/1.4.2/docs/api/java/io/LineNumberReader.html). If every line is of fixed size, in Java you could use a RandomAccessFile. On Sun, Oct 25, 2009 at 3:30 AM, tommy c wrote: > > I have a huge file(>900MB) that I

Re: reading a range from a large file

2009-10-27 Thread Emeka
> > (with-open [#^Reader r (reader "FILE")] > (with-open [lr (java.io.LineNumberReader. r)] > (.setLineNumber lr 5) > ;; Your code here. > ))) > > Can't the below work? (with-open [#^Reader r (reader "FILE")][lr (java.io.LineNumberReader. r)] ( Regards, Emeka --~--~

Re: reading a range from a large file

2009-10-24 Thread Richard Newman
> In clojure, i can grab the first n lines nicely: > (with-open [r (reader "FILE")] (str-join ", " (take n (line-seq r > > How can i grab the first n lines starting from an line offset? ex, > grab lines 5 to 10 rather than just the first 5. (with-open [r (reader "FILE")] (str-join ", "