SQL异常字符去除

 

import pandas as pd
from grant.sql_connection import tellus_conn


sql = r'''select a.uid,REGEXP_REPLACE(a.beizhu, '[\\x00-\\x1F\\x7F]', '') AS beizhu_cleaned from joinleader_app_run.hj_kehutoushuhead_gdc2aqdm a;'''

df = pd.read_sql(sql, tellus_conn)

df.to_excel('df.xlsx', index=False)

  

posted @ 2025-07-21 15:21  CrossPython  阅读(10)  评论(0)    收藏  举报