File size: 420 Bytes
e730543 7f304a0 e730543 04d51d9 e730543 04d51d9 7f304a0 |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
import os
import pandas as pd
def save_remaining_text_to_txt(text, output_folder, page_num):
txt_filename = os.path.join(output_folder, f'page_{page_num + 1}_remaining_text.txt')
with open(txt_filename, "w", encoding="utf-8") as f:
f.write(text)
return txt_filename
def save_to_csv(data, csv_filename):
df = pd.DataFrame(data)
df.to_csv(csv_filename, index=False)
return csv_filename |