Hello Scott M.,
I'm really having trouble understanding why you feel the need to
insult people who have not insulted you?
I don't have any tollerence for idiocy.
I'm also having difficulty understanding why you haven't bothered to
read any of what I wrote. I know that you haven't, because if you
had, you certainly wouldn't say that by my reasoning every file should
be accessed as a string. How can I know that? Well, because I never
said that. In fact, I said (on more than one occassion) exactly the
opposite (and agreed with you).
Why not just use a StreamReader class and parse the values at the
commas?
You can use this technique to parse the file at any character, it
doesn't have to be the comma.
As for the .Split method of a string, it most certainly would serve a practical purpose [...]
we are talking about a file that contains nothing but a string within
it, so using string methods on this string is hardly "stupid".
A string is just a data type that holds a collection of chars.. so all
files are just one big string.
[...] but by no means is it the "right" way. The OP said very little
about
the size of the CSV or how complex the data inside it is.
So if one method handles all scenarios, and another doesn't.. and we don't
know what the inputs are.. then yes there is most definately a Right Way
of doing things. String manipulation, in this case, aint it.
Clearly, you just feel you need to take out some frustration you have
on others. Because any objective person reading what I wrote would
not come to the conclusions you've come to. It sort of sounds like it
doesn't matter what anyone says, you've got the "my way or the
highway" mentality.
Yes.. I feel very frustrated when given a choice between the Right Way and
the Wrong Way, people choose the Wrong Way. I feel frustrated at all
exhibitions of idiocy. This is not to say that idiocy is a permanent
condition. And if people would accept that they were being an idiot for a
moment and then look at the solution provided to correct the situation
their idiocy level would drop dramatically. But no, people cling to being
called an idiot and don't pay attention to the provided solution. "OH MY
GOD! HE CALLED ME AN IDIOT!! What an uncaring bastard!" Hell with you.
Look past being an idiot and look at the solution.
Programming is a form of engineering. It's akin to building any kind of
physical structure. You wouldn't, for example, build a suspension bridge
and then line it with gravel, or build a grass hut in Fairbanks, Alaska.
You could certainly do these things, but if the goal is to build a vehicle
bridge that will last 100s of years, or a domicile for humans to live in,
these are Wrong things to do. The same goes for programming. Just
because something "works" (oh look, the grass hut is livable! It's sunny
and 80 degrees out!) doesnt mean it's the Right Thing (oh crap, its
February and -45 degrees.. and I'm dead because my grass hut wont hold
heat).
-Boo