diff --git a/BankCleaner.py b/BankExcelCleaner.py similarity index 85% rename from BankCleaner.py rename to BankExcelCleaner.py index 60918e5..a055828 100644 --- a/BankCleaner.py +++ b/BankExcelCleaner.py @@ -31,7 +31,11 @@ df["text"] = df["text"].replace(r"[\r\n]+", " ", regex=True) # 7. Remove "#" characters from the 'text' column df["text"] = df["text"].replace(r"#", "", regex=True) -# 8. Prompt user for the output Excel file location +# 8. Reorder columns +desired_order = ["time", "text", "url", "topReactionsCount", "viewsCount", "likes"] +df = df[desired_order] + +# 9. Prompt user for the output Excel file location output_file_path = filedialog.asksaveasfilename( title="Save Cleaned Excel File", defaultextension=".xlsx", @@ -41,6 +45,6 @@ if not output_file_path: print("No output file specified. Exiting.") exit() -# 9. Write the cleaned data to a new Excel file +# 10. Write the cleaned data to a new Excel file df.to_excel(output_file_path, index=False) print(f"Cleaned Excel file saved to: {output_file_path}")