#!/usr/bin/python
fin = open('/home/hanyh/fly.sql','r')
fout = open('/home/hanyh/fly2.sql','w')
for line in fin:
if line.startswith('CREATE TABLE') or line.startswith('DROP TABLE') or line.startswith('LOCK') or line.startswith('/*!40000 ALTER TABLE'):
line = line.upper()
elif line.startswith('INSERT INTO'):
end =line.find('VALUES')
oldstr = line[0:end]
newstr = oldstr.upper()
line = newstr+line[end:]
fout.write(line)
fin.close()
fout.close()
windows作的程序移植到linux下,对表名字有大小写要求。