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
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
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:
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
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
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
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
>
>
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
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
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
--~--~-~--~--
10 matches
Mail list logo