September 05, 2007

csv2sql

如果有大量的 csv 格式資料(逗點分隔的文字檔)要匯入資料庫, 可以這樣做
sed -e "s/^/INSERT TABLE_NAME values('/;s/$/');/;s/,/','/g" file.csv > file.sql

Posted by pank at September 5, 2007 11:23 AM
Comments
Post a comment













Remember personal info?