APK hataları

WhatsApp sohbeti Excel'de ə harfini bozar

Azerbaycan telefonundan çıkan sohbet şöyle bir satırdır: 12.10.2026, 14:05 - Əli: salam. Dosya UTF-8'dir. Excel'e çift tıklayınca sistem tablosuyla açar. Orada ə yoktur, harf ? ya da başka bir işaret olur.

.txt dosyasını Excel'e doğrudan açma. Önce CSV yaz ve başına BOM koy.

from pathlib import Path
import csv

text = Path("sohbet.txt").read_text(encoding="utf-8")
rows = []
for line in text.splitlines():
    if " - " not in line or ": " not in line:
        continue
    left, message = line.split(": ", 1)
    when, name = left.split(" - ", 1)
    rows.append((when, name, message))

with open("sohbet.csv", "w", newline="", encoding="utf-8-sig") as fayl:
    writer = csv.writer(fayl)
    writer.writerow(["tarix", "ad", "mesaj"])
    writer.writerows(rows)