Re: Very noob file reading and printing question

2009-01-07 Thread Tom Ayerst
Oops, sorry Paul (In your favour I expect people can probably pronounce your surname! ;-) Cheers Tom 2009/1/7 Paul Barry > No Problem Ayerst :) Just kidding, people call me Barry all the time, even > though my first name is Paul. That's the curse of having 2 first names I > guess. > > > On W

Re: Very noob file reading and printing question

2009-01-07 Thread Paul Barry
No Problem Ayerst :) Just kidding, people call me Barry all the time, even though my first name is Paul. That's the curse of having 2 first names I guess. On Wed, Jan 7, 2009 at 8:17 AM, Tom Ayerst wrote: > Thanks Barry, I now see what I did. > > I tried doseq early but it didn't print anythin

Re: Very noob file reading and printing question

2009-01-07 Thread Tom Ayerst
Thanks Barry, I now see what I did. I tried doseq early but it didn't print anything. I had: (with-open [r (reader "doc.txt")] (doseq [line (line-seq r)] println line)) so I wasn't evaluating the println. Cheers Tom 2009/1/7 Paul Barry > Here's a little cleaner version using doseq:

Re: Very noob file reading and printing question

2009-01-07 Thread Paul Barry
Here's a little cleaner version using doseq: (use 'clojure.contrib.duck-streams) (with-open [r (reader "doc.txt")] (doseq [line (line-seq r)] (println line))) On Wed, Jan 7, 2009 at 7:27 AM, Tom Ayerst wrote: > Thanks Brian. > > I finally nailed it with: > > (use '[clojure.contrib.duck-strea

Re: Very noob file reading and printing question

2009-01-07 Thread Tom Ayerst
Thanks Brian. I finally nailed it with: (use '[clojure.contrib.duck-streams :only (reader)]) (with-open [r (reader "doc.txt")] (dorun (for [line (line-seq r)] (do (println line) Cheers Tom 2009/1/6 Brian Doyle > > On Tue, Jan 6, 2009 at 4:47 PM, Tom Ayerst wrote: > >> Its not t

Re: Very noob file reading and printing question

2009-01-06 Thread Brian Doyle
On Tue, Jan 6, 2009 at 4:47 PM, Tom Ayerst wrote: > Its not the println, nor getting a reader (duckstreams is fine, I can do > that). Its the converting it to a seq and stepping through it printing each > element (which should be a line). Its the loopy, steppy bit, just for a side > effect; that

Re: Very noob file reading and printing question

2009-01-06 Thread Tom Ayerst
Its not the println, nor getting a reader (duckstreams is fine, I can do that). Its the converting it to a seq and stepping through it printing each element (which should be a line). Its the loopy, steppy bit, just for a side effect; that I am messing up. Cheers Tom 2009/1/6 Mark Volkmann > >

Re: Very noob file reading and printing question

2009-01-06 Thread Mark Volkmann
On Tue, Jan 6, 2009 at 5:26 PM, Tom Ayerst wrote: > Hi, > > How do I read and print a text file? I can read it, its the printing that > is the problem, I feel it should be obvious but I keep tripping myself up. > (The context is I need to extract data line by line, translate the line > format an

Re: Very noob file reading and printing question

2009-01-06 Thread Cosmin Stejerean
On Tue, Jan 6, 2009 at 5:26 PM, Tom Ayerst wrote: > Hi, > > How do I read and print a text file? I can read it, its the printing that > is the problem, I feel it should be obvious but I keep tripping myself up. > (The context is I need to extract data line by line, translate the line > format an

Very noob file reading and printing question

2009-01-06 Thread Tom Ayerst
Hi, How do I read and print a text file? I can read it, its the printing that is the problem, I feel it should be obvious but I keep tripping myself up. (The context is I need to extract data line by line, translate the line format and save it for a legacy app) Thanks Tom --~--~-~--~--