一.自动输出中文字符集 select * from db into outfile 'test.csv' CHARACTER SET gbk fields terminated by ',' optionally enclosed by '"' escaped by '"' lines terminated by '\r\n'; 二.导出后转换字符集 转换成CSV文件,如果乱码将CSV已记事本打开另存为UTF8 select * from db into outfile 'test.c
import csvdef convert_txt_to_csv(out_file_path, input_file_path, txt_sep): #定义输出路径,输入文件路径,txt的分隔符 with open("./temp.csv", "w", newline = "") as csv_file: writer = csv.writer(csv_file) mark = 0 with open(temp_path) as f: for l
INSERT INTO TTT (NSAME, ID, AGE) VALUES ('AAA', '201023210816', '22'); 将上面的SQL格式改成以下的格式 AAA|201023210816|22 import os lists=[] paths = os.getcwd() for root,dirs,files in os.walk('wfyh'): for fn in files: lists.append(fn) for nmb in lists: dfile=open(