From: "Ara.T.Howard" Date: 2005-11-01T05:01:53+09:00 Subject: Re: csv.rb a start on refactoring. On Tue, 1 Nov 2005, James Edward Gray II wrote: > Ah, I forgot to glance at the grammar. The above pretty much proves (to me), > that we're looking at malformed CSV. yup. > That's good news, because it means whatever we decide is right. ;) We're > off the map here anyway. > > To me, it's a decision about what you consider \r to be. The current CSV > seems to call it a line ending. I'm more inclined to consider it whitespace. > If I found a \v (vertical tab), I would leave it in the field because spaces > are a part of the field. I feel the same about \r. > > I also would rather avoid throwing an Exception here. "Be liberal in what > you accept," as the saying goes. Stripping it seems against the spirit of > the format, so I guess that leaves calling it a line ending or whitespace. i agree in principle - but design wise i'd say be consistent, if you are going to handle stray \r then we need rules for stray \n, command, and " too - this will make the code more complex and, i fear, slow. perhaps it's safest and easiest to simply bail if the csv is not perfect. 2cts. -a -- =============================================================================== | email :: ara [dot] t [dot] howard [at] noaa [dot] gov | phone :: 303.497.6469 | anything that contradicts experience and logic should be abandoned. | -- h.h. the 14th dalai lama ===============================================================================