getting data out: mysql -> csv

david thornton david-FkEgs2FKm2NvBvnq28/GKQ at public.gmane.org
Sun Jun 10 16:36:48 UTC 2007


Emma Jane Hogbin wrote:

> Good afternoon,
>
> I'm in the process of trying to yank content out of one CMS and into 
> another CMS. The import function on the new CMS requires that the data 
> be in a CSV. This should be 'easy'... except the data contains new 
> lines and tabs (apparently) because each time I try to export the 
> data, it doesn't play nicely as a CSV.
>
> I've tried googling "mysql export csv" and found the following:
> http://forums.mysql.com/read.php?79,11324,13062#msg-13062
> I don't have the select into outfile flag
> and
> http://tlug.dnho.net/?q=node/209
> The explanation of the sed cleanup is wrong, I know.
>
> In the first option there is a follow-up question which is exactly the 
> same as mine... "what if there are characters in the data which are 
> the same characters that are to be used as delimiters?" I've asked the 
> techs to enable the "select into outfile" option for me.. but in the 
> mean time, my question remains: how do you get HTML fragments 
> (especially when there are new lines, tabs and quotes as part of the 
> data) out of a MySQL table and into a CSV?
>
>
> regards,
> emma
> -- 
> The Toronto Linux Users Group.      Meetings: http://gtalug.org/
> TLUG requests: Linux topics, No HTML, wrap text below 80 columns
> How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists

I just found an interesting perl module called SQL::Translate. Doesn't 
just do SQL.

http://search.cpan.org/~jrobinson/SQL-Translator-0.08/lib/SQL/Translator.pm

David
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list