<commit_before>"""
provrdr.py

"""

import argparse
import sys
import csv


parser = argparse.ArgumentParser(description="Process ProvidentCU bank statements.")
parser.add_argument("infile", 
	type=str, 
	default=sys.stdin,
	help=".cvs file to be read in")
parser.add_argument("outfile", 
	nargs='?', 
	type=str, 
	default='outfile.txt',
	help="optional output file")
args = parser.parse_args()
	
infile = args.infile
outfile = args.outfile

strarr = []
try:
	with open(infile, newline='') as f:
		reader = csv.reader(f)	
		for row in reader:
			strarr.append(row)
	f.close()
except IOError:
	sys.exit('Could not read file: {}\n'.format(infile))


print(strarr)
"""
list2 = []
for r in strarr:
	list2.append(list(filter(None, r)))
print(list2)

"""
of = open(outfile, 'w')
of.write(str(strarr))
#for rw in list2:
#	of.write('{} \n'.format(rw))
of.close
<commit_msg>Apply filter to input<commit_after>"""
provrdr.py

"""

import argparse
import sys
import csv

#
# Parse command line arguments
#
parser = argparse.ArgumentParser(description="Process ProvidentCU bank statements.")
parser.add_argument("infile", 
	type=str, 
	default=sys.stdin,
	help=".cvs file to be read in")
parser.add_argument("outfile", 
	nargs='?', 
	type=str, 
	default='outfile.txt',
	help="optional output file")
args = parser.parse_args()
	
infile = args.infile
outfile = args.outfile

#
# Read .csv file 
#
data = []

try:
	with open(infile, newline='') as f:
		reader = csv.reader(f)	
		for row in reader:
			data.append(list(filter(None, row)))
	f.close()
except IOError:
	sys.exit('Could not read file: {}\n'.format(infile))


print(data)

of = open(outfile, 'w')
#of.write(str(data))
for rw in data:
	of.write('{} \n'.format(rw))
of.close

{'fraction_non_alphanumeric': 0.16346713205351948, 'fraction_numerical': 0.002326934264107039, 'mean_word_length': 4.695364238410596, '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': '3766964', 'n_tokens_mistral': 674, 'n_tokens_neox': 644, 'n_words': 157}