Initial commit: What To Cook (WTC) v4.4 - Digitales Kochbuch, Wochenmenueplan & Buchdruck
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import os
|
||||
import json
|
||||
|
||||
DIR = '/home/maxi/Projekt/wtc.waiswuaschd.de/data/extracted_texts'
|
||||
|
||||
files = sorted(os.listdir(DIR))
|
||||
for f in files:
|
||||
if f in ['Rezeptkarten.txt', 'ramen_rezepte.txt']:
|
||||
continue
|
||||
path = os.path.join(DIR, f)
|
||||
with open(path, 'r', encoding='utf-8', errors='ignore') as fp:
|
||||
txt = fp.read().strip()
|
||||
print(f"=== {f} ===")
|
||||
lines = [l.strip() for l in txt.split('\n') if l.strip()]
|
||||
print("\n".join(lines[:20]))
|
||||
print("\n--- LAST 10 LINES ---")
|
||||
print("\n".join(lines[-10:]))
|
||||
print("="*40)
|
||||
Reference in New Issue
Block a user