gpt4 book ai didi

postgresql - 上传 CSV 文件,字符失真

转载 作者:行者123 更新时间:2023-11-29 12:24:57 25 4
gpt4 key购买 nike

我在通过以下查询上传 csv 文件时遇到问题,

COPY adwords_initial("Account",
"Week",
"Campaign",
"Keyword",
"Ad group",
"Keyword state",
"Match type",
"Max. CPC",
"Clicks",
"Impressions",
"Cost",
"Avg. position",
"Ad group state",
"Campaign state",
"Status",
"Qual. score (hist.)",
"Expected clickthrough rate (hist.)",
"Ad relevance (hist.)",
"Landing page experience (hist.)",
"First page CPC",
"First position CPC",
"Top of page CPC",
"Bounce rate","Pages / session",
"Avg. session duration (seconds)",
"% new sessions",
"Search Exact match IS",
"Search Lost IS (rank)",
"Search Impr. share",
"Conversions",
"Conv. rate")
FROM 'C:\Users\iantu\Desktop\Performance Marketing\Report inputs\input.csv'
DELIMITER ',' CSV HEADER encoding 'windows-1251';

例如法语中的字符没有相应地翻译

in keyword the original file has  +connectivité +IoT
in keyword the postgresql file has +connectivitй +IoT

是否必须在我的应用程序中更改设置?

我还应该提到,我然后使用以下查询导出它,但是,可以看到的数据已经在数据库中损坏。

COPY (SELECT * FROM adwords_initial) TO 'C:\Users\iantu\Desktop\Performance Marketing\Report Outputs\in between workflow.csv' WITH CSV HEADER;

最佳答案

使用latin1作为编码:

COPY adwords_initial("Account",
"Week",
"Campaign",
"Keyword",
"Ad group",
"Keyword state",
"Match type",
"Max. CPC",
"Clicks",
"Impressions",
"Cost",
"Avg. position",
"Ad group state",
"Campaign state",
"Status",
"Qual. score (hist.)",
"Expected clickthrough rate (hist.)",
"Ad relevance (hist.)",
"Landing page experience (hist.)",
"First page CPC",
"First position CPC",
"Top of page CPC",
"Bounce rate","Pages / session",
"Avg. session duration (seconds)",
"% new sessions",
"Search Exact match IS",
"Search Lost IS (rank)",
"Search Impr. share",
"Conversions",
"Conv. rate")
FROM 'C:\Users\iantu\Desktop\Performance Marketing\Report inputs\input.csv'
DELIMITER ',' CSV HEADER encoding 'latin1';

关于postgresql - 上传 CSV 文件,字符失真,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45323764/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com