<commit_before>
import tkFileDialog
import joincsv
import os.path

if __name__ == '__main__':
    filetypes=[("Spreadsheets", "*.csv"),
               ("Spreadsheets", "*.xls"),
               ("Spreadsheets", "*.xlsx")]
    
    input_filename = tkFileDialog.askopenfilename(filetypes=filetypes)
    
    if not os.path.isfile(input_filename):
        exit(0)
    
    output_filename = tkFileDialog.asksaveasfilename(filetypes=filetypes, defaultextension=".csv")
    if not os.path.isfile(output_filename):
        exit(0)
        
    joiner = joincsv.RecordJoiner(input_filename)
    joiner.save(output_filename)
    <commit_msg>Now accepts input as command line argument. Allows use in context menus.<commit_after>
import tkFileDialog
import joincsv
import os.path
import sys

if __name__ == '__main__':
    filetypes=[("Spreadsheets", "*.csv"),
               ("Spreadsheets", "*.xls"),
               ("Spreadsheets", "*.xlsx")]
    
    if len(sys.argv) == 2:
        input_filename = sys.argv[1]
    else:
        input_filename = tkFileDialog.askopenfilename(filetypes=filetypes)
    
    if not os.path.isfile(input_filename):
        exit(0)
    
    output_filename = tkFileDialog.asksaveasfilename(filetypes=filetypes, defaultextension=".csv")
    if not os.path.isfile(output_filename):
        exit(0)
        
    joiner = joincsv.RecordJoiner(input_filename)
    joiner.save(output_filename)
    
{'fraction_non_alphanumeric': 0.1181046676096181, 'fraction_numerical': 0.004243281471004243, 'mean_word_length': 3.0428571428571427, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4845929', 'n_tokens_mistral': 465, 'n_tokens_neox': 460, 'n_words': 83}