added files

This commit is contained in:
2025-08-28 16:53:07 +02:00
commit a3dd5afb3f
4 changed files with 3025 additions and 0 deletions

1000
Top 1000 Words.txt Normal file

File diff suppressed because it is too large Load Diff

1001
Top_1000_words.csv Normal file

File diff suppressed because it is too large Load Diff

1001
Top_1000_words_utf8.csv Normal file

File diff suppressed because it is too large Load Diff

23
main.py Normal file
View File

@@ -0,0 +1,23 @@
import csv
def main():
with open("Top 1000 Words.txt", "r", encoding="utf-8") as file:
data = file.read().strip()
print(data)
print(type(data))
splitted_string = data.split("\n");
formated_string = []
for line in splitted_string:
formated_string.append(line.split(" \t"))
print(formated_string)
with open("Top_1000_words.csv", "w", encoding="utf-8", newline="") as file:
writer = csv.writer(file)
field = ["num", "french", "english"]
writer.writerow(field)
writer.writerows(formated_string)
if __name__ == "__main__":
main()