Paip. How to resolve the problem of importing data into mysql
# --- Cause: mysql import tool bug
# --- Solution: Double quotation marks are not included in the phonetic alphabet.
Author old wow's paw Attilax iron, EMAIL: 1466519819@qq.com
Reprinted please indicate Source: http://blog.csdn.net/attilax
From log import *
IniLog (r "c: \ enWzPhonetic. log ")
N = 0
For line in lines:
If (n> 100000): break;
If (not isContain (line, "["): continue;
Word = left_ByFirstChar (line, r "[")
Word = trim (word)
Logging.info ("start to word:" + word)
Phonetic = subStrNtrim (line, r "[", r "]")
Phonetic = replace_multiple (phonetic, splitor, spltrFinal)
Phonetic = trim_multi (phonetic ,"@")
Logging.info (word + "--- \" "+ phonetic + "\"")
# Todox import mysql5.6 empty, in phntc, so. must include use doubleQuot
Line = word + "\ t \" "+ phonetic + "\""
FileHandle. write (line + "\ n ")
N = n + 1
# Endfor
Print ("ah? B? 'Rei ?? N ")
FileHandle. close ()