19 lines
552 B
Python
19 lines
552 B
Python
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)
|