From 775ab0c688d03f11d2f13be9878151f26ccef6a3 Mon Sep 17 00:00:00 2001 From: Jonathan Hite Date: Fri, 7 Feb 2025 23:44:31 -0500 Subject: [PATCH] deleted file --- removecomma.py | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 removecomma.py diff --git a/removecomma.py b/removecomma.py deleted file mode 100644 index c2c76d9..0000000 --- a/removecomma.py +++ /dev/null @@ -1,28 +0,0 @@ -import os -import re - -def process_file(input_filename, output_filename): - """Reads a file line by line, removing commas from lines that do not contain a number.""" - - if not os.path.exists(input_filename): - print(f"❌ Error: File '{input_filename}' not found. Please check the path.") - return # Exit the function - - with open(input_filename, 'r', encoding='utf-8') as infile, \ - open(output_filename, 'w', encoding='utf-8') as outfile: - - for line in infile: - if re.search(r'\d', line): # Checks if line contains any digit (0-9) - outfile.write(line) # Keep the line as is - else: - cleaned_line = line.replace(',', '') # Remove commas - outfile.write(cleaned_line) # Write the cleaned line - - print(f"✅ Processing complete! Cleaned file saved as '{output_filename}'.") - -# Example usage -input_file = "games/forgotten_ruins_gpt.csv" -output_file = "games/cleaned_forgotten_ruins_gpt.csv" - -process_file(input_file, output_file) -