diff --git a/convert.py b/convert.py new file mode 100644 index 0000000000000000000000000000000000000000..00cee2e00ccaf165c72da70041e144b9aa82ab69 --- /dev/null +++ b/convert.py @@ -0,0 +1,4 @@ +f = open("unknown.txt", encoding="utf_16_be") +str = f.read() +with open("known.txt", "w", encoding="utf-8", newline="\r\n") as file: + file.write(str) diff --git a/data_excel.csv b/data_excel.csv new file mode 100644 index 0000000000000000000000000000000000000000..57db074bd558129178751c4aad1afba372d6e0ae --- /dev/null +++ b/data_excel.csv @@ -0,0 +1,4 @@ +国家,首都 +中国,北京 +美国,华盛顿 +俄罗斯,莫斯科 diff --git a/data_unix.csv b/data_unix.csv new file mode 100644 index 0000000000000000000000000000000000000000..74267c5d8d2122c37c540a3413550033ccc785d8 --- /dev/null +++ b/data_unix.csv @@ -0,0 +1,4 @@ +国家,首都 +中国,北京 +美国,华盛顿 +俄罗斯,莫斯科 diff --git a/make_excel_csv.py b/make_excel_csv.py new file mode 100644 index 0000000000000000000000000000000000000000..98a1aa67c25f0de52c6a348a6217f43b5589125c --- /dev/null +++ b/make_excel_csv.py @@ -0,0 +1,9 @@ +import pandas as pd + +df = pd.DataFrame( + { + "国家": ["中国", "美国", "俄罗斯"], + "首都": ["北京", "华盛顿", "莫斯科"], + } +) +df.to_csv("data_excel.csv", index=False, encoding="utf-8-sig", lineterminator="\r\n")