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 <wheels...@gmail.com> wrote:

>
> I have a huge file(>900MB) that I would like to read/process in
> chunks.
>
> 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.
>
> I can do this in java using traditional java way by using
> LineNumberReader's setLineNumber(int lineNumber)  but i'm not sure how
> to interweave this in with clojure's file sequence operations.
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to