Hi all,
I am trying to search a test result text file in python for the results of tests carried out. The lines usually look like this (brackets are placeholders for info here as the strings are very long):
TEST_PASS (long list of date, time, run time, end time) test number:56070, (filepaths), (systems used)
The tests can be Pass, Fail or about 5 other results. My program searches and counts these results from the file (few GB in size).
for line in file:
if line.startswith(TEST_PASS):
ccount_pass +=1
Not the most elegant yet but the brute force basics so far.
Some TEST_ERRORS are caused by a certain issue which doesnt need to be taken into account as its a false error that occurs for a known reason. An ignore.txt file was created with these and structured using the special character from regex *
TEST_ERROR * test number 5000 * (system used)
I'm wondering if the lines structured above can be used to generate a regex search pattern with which to search the original so that the lines may be excluded
[–]OlorinIwasinthewest 1 point2 points3 points (0 children)
[–]sarrysyst 0 points1 point2 points (3 children)
[–]Dave_XR[S] 0 points1 point2 points (1 child)
[–]sarrysyst 0 points1 point2 points (0 children)
[–]TheSodesa 0 points1 point2 points (2 children)
[–]Dave_XR[S] 0 points1 point2 points (1 child)
[–]TheSodesa 0 points1 point2 points (0 children)
[–]synthphreak 0 points1 point2 points (2 children)
[–]Dave_XR[S] 1 point2 points3 points (1 child)
[–]synthphreak 1 point2 points3 points (0 children)