Looking for a C program to parse CSV

M

Mark McIntyre

There is a world of difference between using slang in contexts where
it's not appropriate and ending your sentences with a preposition. So no
-- one might not "as well" say that.

Obviously I disagree. It may be a common usage in certain parts of the
world, but that doesn't make it correct grammar and more than slang
usage is correct.
If you're looking for an absolute stance on what makes language use
right and wrong, however, I have none to offer you, and wouldn't trust
people who claim they do.
*shrug*.

I was merely pointing out that I cannot agree
with people who judge that ending a sentence with a preposition is
wrong, because they have nothing more concrete to offer than "because we
say so".

And what, pray, are any rules of grammar but "because thats how it
is"? Be sensible.
 
D

Default User

Mark said:
On Sat, 08 Oct 2005 01:02:51 +0200, in comp.lang.c , Skarmander
(of the rule of english grammar that you may not end a sentence with a
preposition)


If you can't see how bogus this argument is, I pity you. One might as
well say that slang is proper engish, innit like, y'know?

You're wrong. The bit about prepositions was invented out of whole
cloth by certain self-appointed language purists. It never has been a
violation of grammar to formulate sentences that way.

Here's the relevant bit from the alt.usage.english FAQ:

Fowler and nearly every other respected prescriptivist see
NOTHING wrong with ending a clause with a preposition; Fowler
calls it a "superstition". ("Never end a sentence with a
preposition" is how the superstition is usually stated, although it
would "naturally" extend to any placement of a preposition later
than the noun or pronoun it governs.) Indeed, Fowler considers "a
good land to live in" grammatically superior to "a good land in
which to live", since one cannot say *"a good land which to
inhabit".



Brian
 
S

Skarmander

Mark said:
Obviously I disagree. It may be a common usage in certain parts of the
world, but that doesn't make it correct grammar and more than slang
usage is correct.
Well, this is where the chips come down and we both confess that we have
no actual clue as to how common or uncommon ending your sentence with a
preposition is. Certain parts of the world for sure, but which parts for
certain?

Just because you "know" it's wrong, and I "know" it's not, doesn't make
either of us right, does it? We'd need to hunt down independent sources
and get our facts straight, rather than making appeals to authority --
so we'll probably have to agree to disagree on the particular issue, and
when I'm around you I'll have to be careful about what I end my
sentences with.

Try to reformulate that last sentence to comply with the vaunted rule,
by the way. It's instructive. :)

And what, pray, are any rules of grammar but "because thats how it
is"? Be sensible.

Linguistics is a science. That is, we can study language, formulate
hypotheses, and test these. The difference between "because we say so"
and "because that's how it is" should be immediately obvious now.
Whether a grammatical rule is "real" is something that can be made more
or less plausible by observing actual application.

What complicates the issue enormously, however, and what is at the heart
of our disagreement, is the fact that language is man-made (some would
claim wholly, most only partially). In a sense, language is "whatever we
make of it". So in that sense, you're certainly right. If you say
sentences should not end with prepositions because that's ungrammatical,
who am I to say that's a silly, arbitrary rule? So is declining
pronouns. Yet someone who refuses to decline is criticized for poor
grammar, and rightly so. The rules are not imaginary or a free-for-all;
there's right and wrong.

So who gets to decide right and wrong? If I tell everyone not to use
"henceforth" anymore because it's an outdated construction that can
easily be replaced with the catchier "from that point on", and they
actually listen to me, then henceforth it's no longer proper English --
archaic at best.

But of course this almost never happens. Instead language mutates in the
wild, according to ill-understood processes that have very little to do
with rational thought, and all the more with how our language instincts
work. "Henceforth" acquires a mothball smell because people simply stop
using it, or use it only in certain contexts.

The rules of grammar as expounded by books, grammarians and classrooms
are at any time a compromise between what is actually spoken and what is
believed to be spoken; what of this is proper, and what not. The rules
as written down are invariably lagging behind actual usage -- mind you,
I say "lagging behind", implying that the rules are eventually adapted
to accommodate live usage, not the other way around. This is because
those who teach language (the part that can be taught) are always the
minority compared to those who use language, both in numbers and
influence. And in language, sad to say for the teachers, tyranny of the
majority does apply.

A change of language always starts out small. When one person does it,
it's wrong. When it's picked up by others, it's slang, or dialect. As it
grows it may become "mainstream", possibly still frowned upon or
"considered informal" by more conservative elements. This non-state can
persist for a very long time, even when everybody is doing it except
those who insist it's wrong because they remember a time when not
everyone was doing it. Eventually they succumb, and the official record
is updated to reflect actual use. This process is much faster for new
words than it is for changes in grammar, but the same principles apply.

Now, what does all this have to do with ending your sentences in a
preposition?! Simple: I believe this particular rule not to be part of
live English; English as spoken by well-intended people who respect a
consensus vision on what proper English should be, and who appreciate
clear communication (an elitist and snobby description, but you get my
drift). It's something cooked up by grammarians because they had visions
of how the language ought to look that had nothing to do with how it was
used.

In doing so, they did not *add* to the man-made construct called
English, they impoverished it by outlawing something for no other reason
than that it did not match their vision of English -- not because anyone
somehow failed to understand these constructions correctly, not because
clear communication was threatened. Grammarians are as free to try and
change the language as anyone else -- and everyone is equally free to
ignore them. The measure of a rule of grammar is how well it is
followed, not how sensible it is to its creators. This is a scary
prospect to those who believe that language is something we wholly
control by application of reason and sensibility, but the fact is, we don't.

I'm not trying to win an argument, just explaining where I'm coming
from. If I have to be any *more* sensible I'll have to invite you to
come over to my place for coffee or tea and we'll talk about this until
we're both blue in the face, but for now let's spare the other folks in
this ng, OK? :) I respect your belief that not ending your sentences in
a preposition is a hallmark of proper grammar, though I disagree, and
will continue to merrily end my sentences in prepositions whenever I
think it's appropriate; the argument of who is right can be postponed.

S.
 
M

Mark McIntyre

You're wrong.

Obviously, I disagree. Call me a language purist if you like.
The bit about prepositions was invented out of whole
cloth by certain self-appointed language purists.

Which is of course how absolutely any 'rule of grammar' was
'invented'.
Here's the relevant bit from the alt.usage.english FAQ:

Last time I checked, usenet, especially the alt hierarchy, was not
considered a reliable source of information !
 
M

Mark McIntyre

and
when I'm around you I'll have to be careful about what I end my
sentences with.
Try to reformulate that last sentence to comply with the vaunted rule,
by the way. It's instructive. :)

I'll just try the last clause if its ok:

"You'll have to be careful with what you end your sentences."
or
"You'll have to be careful with which word types you end your
sentences."

Golly that was tricky. In fact the 2nd is probably slightly clearer
than the original...
Linguistics is a science.

ROFL.
 
K

Keith Thompson

Default User said:
Here's the relevant bit from the alt.usage.english FAQ:

Speaking of alt.usage.english, it does exist, and is an appropriate
place for this discussion. comp.lang.c is not.
 
S

Skarmander

Mark said:
I'll just try the last clause if its ok:

"You'll have to be careful with what you end your sentences."

Nope, sorry. That would have to be "careful about with what you end your
sentences". You can't remove "about" here, because "being careful with"
leaves "what you end your sentences" as a phrase, which isn't
grammatical; the verb phrase is "to end with".

I'll just stick that "with" at the end, thank you.
or
"You'll have to be careful with which word types you end your
sentences."

Golly that was tricky. In fact the 2nd is probably slightly clearer
than the original...
Hmm, yeah. Like anyone who's not a programmer would mention "word
types". :)

That's one way to end a thread, I guess. If you like, I can amend it to
"some parts of linguistics can be approached scientifically".
Nevertheless, I'm glad I amuse you.

S.
 
M

Malcolm

Skarmander said:
and when I'm around you I'll have to be careful about what I end my
sentences with.

Try to reformulate that last sentence to comply with the vaunted rule, by
the way. It's instructive. :)
and when I'm around you I'll have to be careful about that with which I end
my sentences.

I agree. This is hopelessly old-fashioned.

<On T>
You can have compileable gibberish in English as well as in C.
</On T>
 
D

Default User

Mark said:
Obviously, I disagree. Call me a language purist if you like.

I will not. You aren't a purist, you're incorrect. A purist would
promulgate actual rules not bogus ones.
Last time I checked, usenet, especially the alt hierarchy, was not
considered a reliable source of information !

Pretty odd statement from coming from a denizen of a usenet group that
thinks its musings on a language should be taken seriously, and that
its FAQ should be used a reference for that language.

However, as Keith has pointed out, this isn't the place to debate it.
If you'd like to continue it over to alt.usage.english, be my guest.



Brian
 
M

Mabden

Mark McIntyre said:
Obviously, I disagree. Call me a language purist if you like.


Which is of course how absolutely any 'rule of grammar' was
'invented'.

But the rule of never starting a sentence with a conjunction is still
valid, isn't it? And, there are cases when the convoluted sentences are
made much clearer by not using convolutions with which to use to avoid
saying.
Last time I checked, usenet, especially the alt hierarchy, was not
considered a reliable source of information !

But, it's that with which we are stuck. No body read BOOKS anymore.

My pet peeve are those who don't know when to use whom. Everybody get
the difference between her and she, him and he, etc. but are baffled by
the who and whom connection, even though it is identical usage. I
explain it this way: if you could use he then use who, if you would use
him use whom; he = who, him = whom (notice the m at the end).
"You went with him?" = "You went with whom?" NOT "You went with he?" =
"You went with who?"
"He and I went..." = "Who went ..."

Seems simple to me.
 
F

Frodo Baggins

Mark said:
I'll just try the last clause if its ok:

"You'll have to be careful with what you end your sentences."
or
"You'll have to be careful with which word types you end your
sentences."

Golly that was tricky. In fact the 2nd is probably slightly clearer
than the original...


ROFL.
<snip>

Pray tell me ppl, what all this hogwash got to do with Standard C ??

I think everyone parsed what was said by the original author, so why
bother?
Regards,
Frodo Baggins
 
M

Mabden

Frodo Baggins said:
Pray tell me ppl, what all this hogwash got to do with Standard C ??

That would be, "what has" or "what's". And real words have vowels.

The Standard was written in Standard English. I think I can safely say
that the inventors of BCPL and C were English speakers. English is the
language we are communicating in; whether you are a native speaker or
not. So some semblance of proper English (American English of course,
none of that Limey crap) is required and therefore quite on topic.
 
K

Kenny McCormack

Mabden said:
The Standard was written in Standard English. I think I can safely say
that the inventors of BCPL and C were English speakers. English is the
language we are communicating in; whether you are a native speaker or
not. So some semblance of proper English (American English of course,
none of that Limey crap) is required and therefore quite on topic.

Sing it, sister!
 
K

Keith Thompson

You mean not English English?

Just in case anyone takes this seriously, English English is perfectly
acceptable, and we usually don't worry much about minor spelling and
grammatical mistakes. We do object to silly abbreviations suitable
for a mobile phone keypad, like "u" for "you", and "ppl" for "people";
they make text much more difficult to read.
 
W

websnarf

vvk4 said:
I have an excel spreadsheet that I need to parse. I was thinking of saving
this as a CSV file. And then reading the file using C. The actual in EXCEL
looks like:
a,b a"b a","b a,",b

In CSV format looks like:
"a,b","a""b","a"",""b","a,"",b"

Does anybody have suggestions or have C program based code to parse CSV.

I'm sorry to see you've gotten such worthless responses to your request
before I've managed to come across it. You can find some source here:

http://www.pobox.com/~qed/bcsv.zip

It does the proper thing with respect to quotes, reading input lines
etc, and just feeds the output through a row, column indexed callback.
 
A

A. Sinan Unur

Just in case anyone takes this seriously, English English is perfectly
acceptable, and we usually don't worry much about minor spelling and
grammatical mistakes. We do object to silly abbreviations suitable
for a mobile phone keypad, like "u" for "you", and "ppl" for "people";
they make text much more difficult to read.

Such abbreviations also tend to make it harder for me. I am not a native
speaker, and I have a much easier time parsing content written in mostly
proper English (any variant will do usually) than the chat style. For
the longest time, I did not have the slightest clue what ppl meant, for
example. On more than one occasion, I thought it was a library.

My two cents.

Sinan
 
M

Mabden

Keith Thompson said:
Just in case anyone takes this seriously, English English is perfectly
acceptable, and we usually don't worry much about minor spelling and
grammatical mistakes. We do object to silly abbreviations suitable
for a mobile phone keypad, like "u" for "you", and "ppl" for "people";
they make text much more difficult to read.

There you go pissing on my parade, again. I think I made the ppl point.
Why did you need to chime in with an insult to me? It seems like you
can't stand to have a little humour injected into the conversation,
without putting on the brake. What content did your post bring to the
conversation, except as some kind of Mabden putdown?! Lay off Keith,
plz.

(see how I used plz instead of please to tie in a little humour with the
topicality - neat, huh?! Since you have no sense of humour [or
proportion] I thought I would point it out. Again, a little Zen in the
criticism might help as well. You could have said something like, "There
are basically no words for the way, but we use words to illustrate the
way." Much better.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,048
Latest member
verona

Latest Threads

Top