分类: Python/Ruby
2012-02-01 14:44:37
expert12012-02-26 10:38:35
awk -F \` '/CREATE/{if(tab)print "select " v, "from " tab " into OUTFILE \047/tmp/"tab" \047fields terminated by \042;\042 escaped by \047\\\\\047"
;v="";tab=$2;next}!/ENGINE/{if(v)v=v","$2;else v=$2}END{print "select " v " from " tab " into OUTFILE \047/tmp/"tab " \047fields terminated by \042;\042 escaped by \047\\\\\047"
}'