Writes under /uploads become download chips. Click ↓.
Goal
Write cleaned.txt with city,amount rows.
import re
from pathlib import Path
text = "2026-01-12 Nairobi 126.0\n2026-01-13 Kisumu 62.0\n"
rows = re.findall(r"(\w+) ([\d.]+)$", text, re.M)
Path("cleaned.txt").write_text("city,kes\n" + "\n".join(a + "," + b for a, b in rows) + "\n", encoding="utf-8")
print(Path("cleaned.txt").read_text(encoding="utf-8"))import re
from pathlib import Path
print(re.sub(r"\s+", ",", "Nairobi 12 10.5"))from pathlib import Path
Path("phones_masked.txt").write_text("0712***678\n", encoding="utf-8")
print("wrote phones_masked.txt")from pathlib import Path
print(list(Path(".").glob("*.txt")))