Trans_tools/Auto Trans/Parser.py
2022-12-23 22:20:58 -03:00

18 lines
647 B
Python

#Expects Renpy's dialogue.txt, spits out a original.csv file
import csv
# Open the text file for reading
with open('dialogue.txt', 'r', encoding='utf8') as input_file:
# Open the csv file for writing, using utf8 encoding
with open('original.csv', 'w', newline='', encoding='utf8') as output_file:
# Create a csv writer object
writer = csv.writer(output_file)
# Iterate over the lines in the text file
for line in input_file:
# Strip the newline characters from the line
stripped_line = line.strip()
# Write the original string and an empty string to the csv file
writer.writerow([stripped_line, ''])