Hi all,
I was looking this evening for a quick sample of iterating through a text
file to read it in line by line...
I had already thrown something together myself which resembled the example,
but the main difference being that in my code I simply give the stream
reader the path to my file, where as in the example they opened the text
file, held it in an object, then fed that to the stream reader.
Can anyone advise why a) my way still works! b) whether its better to open
the text file first rather than doing what I'm doing.
Many thanks
RobFrom docs:
File.OpenText Method
"This method is equivalent to StreamReader(String)."
HTH,
Greg
"Rob Meade" <robb.meade@.NO-SPAM.kingswoodweb.net> wrote in message
news:q66%c.1977$1t6.20983855@.news-text.cableinet.net...
> Hi all,
> I was looking this evening for a quick sample of iterating through a text
> file to read it in line by line...
> I had already thrown something together myself which resembled the
> example,
> but the main difference being that in my code I simply give the stream
> reader the path to my file, where as in the example they opened the text
> file, held it in an object, then fed that to the stream reader.
> Can anyone advise why a) my way still works! b) whether its better to open
> the text file first rather than doing what I'm doing.
> Many thanks
> Rob
>
"Greg Burns" wrote ...
> From docs:
> File.OpenText Method
> "This method is equivalent to StreamReader(String)."
Hi Greg,
Many thanks for the reply.
So, my way is ok, and saves some code?
Regards
Rob
Rob Meade wrote:
> "Greg Burns" wrote ...
>
> Hi Greg,
> Many thanks for the reply.
> So, my way is ok, and saves some code?
Sure. In a complex class library like the FCL, there's almost always more
than one way to get things done... or to shoot oneself in the foot ;-)
Cheers,
Joerg Jooss
joerg.jooss@.gmx.net
"Joerg Jooss" wrote ...
> Sure. In a complex class library like the FCL, there's almost always more
> than one way to get things done... or to shoot oneself in the foot ;-)
hehee, thats great, many thanks :o)
/beware of the foot shooting...
Regards
Rob
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment