List:General Discussion« Previous MessageNext Message »
From:Jason Haar Date:March 15 1999 12:21am
Subject:Does MySQL handle CSV files in which records _don't_ end on a CR?
View as plain text  
I'm dumping Outlook "Contacts" into CSV files in the desire to import them
into MySQL. The resultant CSV file begins with a line defining all the field
names, and then the rest of the file is the data. Some of the data contains
CR/LFs, so each record doesn't necessarily end on a CR - however - as there
are 84 fields (defined in line 1), then there are 84 comma-delimited "areas"
in the rest of the file.

MySQL "LOAD FILE" doesn't seem to get this - it just reads to the first CR
it sees and then defaults the rest of that record's fields to NULLs.

Is this a bug, or does anyone have a script or something that'll "clean up"
CSV files into a format MySQL would like? I've looked at perl's CSV modules,
and they appear (at first glance) to suffer from the same problem.

MySQL-3.22.6-alpha under Linux.

-- 
Cheers

Jason Haar

Unix/Network Specialist, Trimble NZ
Phone: +64 3 3391 377 Fax: +64 3 3391 417
Thread
Does MySQL handle CSV files in which records _don't_ end on a CR?Jason Haar15 Mar
  • Re: Query with having does not work properly.sasha26 Jul
  • Re: Query with having does not work properly.Peter Zaitsev27 Jul
  • Re: Query with having does not work properly.Peter Zaitsev28 Jul
  • Re: Query with having does not work properly.sasha28 Jul