Petari/convert.py

13 lines
487 B
Python
Raw Normal View History

2024-10-14 21:33:13 +00:00
def convert_entry(entry):
obj_name = entry.split("[")[1].split(".o")[0]
2024-10-26 17:37:11 +00:00
new_path = f"JSystem/JUtility/{obj_name}.cpp"
2024-10-14 21:33:13 +00:00
return f'Object(NonMatching, "{new_path}"),'
def process_file(input_filename, output_filename):
with open(input_filename, 'r') as infile, open(output_filename, 'w') as outfile:
for line in infile:
converted_line = convert_entry(line.strip())
outfile.write(converted_line + '\n')
process_file('input.txt', 'output.txt')