csv2sql

| | Comments (0)

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

Leave a comment

March 2009

Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        

About this Entry

This page contains a single entry by Pank published on September 5, 2007 11:23 AM.

UNIX2DOS/DOS2UNIX for Windows was the previous entry in this blog.

Windows Live Installer is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.