From c293cac1131de97dbc51a754dc6dad4f8a468302 Mon Sep 17 00:00:00 2001 From: Peter De Vries Date: Thu, 25 Sep 2014 15:17:12 +1000 Subject: [PATCH] removed the wc program requirement. a line count can be performed by python. --- db_converter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db_converter.py b/db_converter.py index 439957b..2b17dcf 100644 --- a/db_converter.py +++ b/db_converter.py @@ -22,7 +22,7 @@ def parse(input_filename, output_filename): if input_filename == "-": num_lines = -1 else: - num_lines = int(subprocess.check_output(["wc", "-l", input_filename]).strip().split()[0]) + num_lines = sum(1 for line in open(input_filename, 'r')) tables = {} current_table = None creation_lines = []