clickhouse及gbase中文字段導(dǎo)出的問題
【1】clickhouse及gbase中文字段導(dǎo)出可能出現(xiàn)換行或者亂碼等情況
導(dǎo)出時(shí)可以使用正則表達(dá)式替換特殊字符
clickhouse: replace(replace(replaceRegexpAll(substring(coalesce(XXXX,''),1,2),'"|\'|\\|/| |\|',''),char(10),''),char(13),'') gbase: replace(replace(regexp_replace(substring(coalesce(XXXX,''),1,2),'"|\'|\\|/| |\|',''),char(10),''),char(13),'')
【2】gbase導(dǎo)出數(shù)據(jù)到文件時(shí),默認(rèn)可能會(huì)是ANSI格式,中文導(dǎo)入其他utf8字符集數(shù)據(jù)庫時(shí)會(huì)亂碼,需要設(shè)置導(dǎo)出utf8格式文件
rmt:select * from tablename into outfile 'xxx.unl' character set utf8 fields terminated by '|';
posted on 2023-10-09 15:44 劍道第一仙 閱讀(369) 評(píng)論(0) 收藏 舉報(bào)
浙公網(wǎng)安備 33010602011771號(hào)