比较文件中增加单行x忽略比较
This commit is contained in:
@@ -56,9 +56,13 @@ def compare_files(source_file, target_file):
|
|||||||
tgt_values = tgt_line.strip().split()
|
tgt_values = tgt_line.strip().split()
|
||||||
|
|
||||||
if len(src_values) != len(tgt_values):
|
if len(src_values) != len(tgt_values):
|
||||||
|
if len(src_values) != 1:
|
||||||
print(f"Error: Line {i+1}: The number of values in {source_file} and {target_file} do not match.")
|
print(f"Error: Line {i+1}: The number of values in {source_file} and {target_file} do not match.")
|
||||||
all_match = False
|
all_match = False
|
||||||
continue
|
continue
|
||||||
|
else:
|
||||||
|
if src_values[0].strip().lower() == 'x':
|
||||||
|
continue
|
||||||
|
|
||||||
line_match = True
|
line_match = True
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user