First, I think Jeff is right. We're getting a bit off-topic here. On 2003-08-28 09:01:59 +1000, Ron Savage wrote: > On Wed, 27 Aug 2003 14:48:25 +0200, Peter J. Holzer wrote: > >> my($s) = "Data\n\r"; > >> > > > > Erm, that should be "Data\r\n", > > Nope. It should be \n\r as stated. I knew someone would fall for that :-). > > I'm trying to show you a situation which you might encounter - I have > - and which simplistic code won't handle.
Well, it also won't handle \036 or \000 as a record separator, which I have seen, too. > The real question is: What, exactly, is the situation the code is > trying to handle? Reading CSV files which were written on another platform. This means understanding the standard line endings of that platform, not some arbitrary record separator that a random programmer used for just this file (for this you should set csv_eol explicitely). And while CRLF is the standard line separator on a widely deployed platform (MS-DOS/Windows) and also on many internet protocols, I don't know any platform which uses LFCR as a line separator. If any file really contains LFCR, it was probably a mistake of the programmer and should be handled in application code (by setting csv_eol), not in a general purpose library. hp -- _ | Peter J. Holzer | Unser Universum wäre betrüblich |_|_) | Sysadmin WSR / LUGA | unbedeutend, hätte es nicht jeder | | | [EMAIL PROTECTED] | Generation neue Probleme bereit. __/ | http://www.hjp.at/ | -- Seneca, naturales quaestiones
pgp00000.pgp
Description: PGP signature