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.

  • Sohbeti mediasız dışa aktar. Çıkan .txt dosyasını UTF-8 olarak oku.
  • CSV'yi encoding="utf-8-sig" ile yaz. Excel o zaman ə harfini görür.
  • Satır tarih - ad: mesaj biçimindedir. Tarihte nokta ya da kesir olabilir. Onu tarihe çevirme, metin tut.
  • Medya satırı ve sistem satırı : taşımaz. Kod onları atlar.
  • .txt dosyasını Excel'e sürükleme. Harf orada bozulur.
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)

İlgili rehberler