Skip to content
Snippets Groups Projects
Commit 822ba049 authored by Tiphaine Viard's avatar Tiphaine Viard
Browse files

Script that creates Iramuteq corpus from txts/ outputs

parent 94e9acc5
No related branches found
No related tags found
No related merge requests found
import sys
import glob
from pathlib import Path
LOG_FILE = "corpus.log"
OUT_FILE = "corpus.txt"
log_fp = open(LOG_FILE, "w")
corpus_file = open(OUT_FILE, "w", encoding="utf-8")
for fname in glob.glob("./txts/*.txt"):
print(fname)
try:
f = open(fname, "r")
print("**** *mapaie", file=corpus_file)
print(f.read().strip(), file=corpus_file)
f.close()
except Exception as e:
print(f"Err {fname}: {e}")
pass
log_fp.close()
corpus_file.close()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment