Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.lang.c Subject: Re: Reading lines from a file, eliminating CR and LF Date: Thu, 29 Dec 2016 11:44:40 -0800 Organization: None to speak of Lines: 26 Message-ID: References: <9a6e5204-d031-4070-88cb-8132072c5c68@googlegroups.com> <7285df88-1603-4edb-abba-b9c5e4172d34@googlegroups.com> <9ab352a9-d804-4eea-8263-219d68c6e821@googlegroups.com> <87ful7dlk5.fsf@bsb.me.uk> <04709823-a412-4700-9597-7e6282bf11de@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: mx02.eternal-september.org; posting-host="e52b6227186de46e02b6ceefa726c58c"; logging-data="22731"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19PQ7n7XoUl32LmW7qfmp/j" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) Cancel-Lock: sha1:dx1weCrxSjTSDm+XfaX7V6PglAw= sha1:8KaFvIPv2gJrGxn7zwkcTtGYjJo= Xref: csiph.com comp.lang.c:100598 Alla _ writes: [...] > Thank you very much. I have to ponder over this; for now I don't yet see > how to check for success, i.e. to check that the file contains only the data > I need, without creating a cumbersome set of character names, including > double quotes (which signal that there are some inner commas > within the name, which do not reflect column separation). I deal with some of > these issues in other functions, i.e. row_names and row_values. [...] In a CSV file, a field surrounded with double quotes doesn't *necessarily* contain commas, but it's *permitted* to contain commas. For example, these are equivalent: one,two,"three,four" "one","two","three,four" There are also rules for how to represent fields that contain quotation marks; you might not need to worry about that, at least initially. -- Keith Thompson (The_Other_Keith) kst-u@mib.org Working, but not speaking, for JetHead Development, Inc. "We must do something. This is something. Therefore, we must do this." -- Antony Jay and Jonathan Lynn, "Yes Minister"