export mysql query report to csv ignore line breaks | |
---|---|
Subject: | |
select quarter, created, transaction, category, tx_from, tx_to, TPS_HST, TVQ, details from transactions WHERE category = 'travel' OR category= 'supplies' OR category = 'travel' OR category = 'subcontract' OR 'corporate' REPLACE(ifnull(category, ''), '\n') INTO OUTFILE 'category.csv' FIELDS TERMINselect quarter, created, transaction, category, tx_from, tx_to, TPS_HST, TVQ, details from transactions WHERE category = 'travel' OR category= 'supplies' OR category = 'travel' OR category = 'subcontract' OR 'corporate' INTO OUTFILE 'category.csv' FIELDS TERMINATED BY ',';
references: http://stackoverflow.com/questions/3255766/mysql-into-outfile-escape-or-replace-new-lines-in-data
SELECT id, title, REPLACE(content , CHR(13), ' ') as content INTO OUTFILE '/content.csv' FIELDS TERMINATED BY ',' ESCAPED BY '\\' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' FROM content where CHR(13) represents new line. | |
2015-07-14 00:28:18 | gstlouis |