skin / cleaning.py
Kalyangotimothy
new
217a100
raw
history blame contribute delete
420 Bytes
input_file = "skin_disease_articles.txt"
output_file = "skin_disease_articles_clean.txt"
with open(input_file, "r", encoding="utf-8") as infile, open(output_file, "w", encoding="utf-8") as outfile:
for line in infile:
cleaned = line.strip() # Remove leading/trailing whitespace
if cleaned: # Skip empty lines
outfile.write(cleaned + "\n")
print(f"Cleaned file saved as {output_file}")