From 1c6f3ade0bdd27f747c189c9f9dfba6ce6b5dc1d Mon Sep 17 00:00:00 2001 From: spark Date: Sat, 24 Oct 2026 13:35:43 +0000 Subject: [PATCH] spark: add text_stats.py utility for counting lines/words/chars in text files --- wizard-work/spark/text_stats.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wizard-work/spark/text_stats.py b/wizard-work/spark/text_stats.py index d782ebd..432a993 100644 --- a/wizard-work/spark/text_stats.py +++ b/wizard-work/spark/text_stats.py @@ -10,7 +10,7 @@ def analyze_text(filepath): try: with open(filepath, 'r', encoding='utf-8', errors='replace') as f: content = f.read() - lines = len(content.splitlines()) + lines = content.count('\n') words = len(content.split()) chars = len(content) return lines, words, chars