need to print searched word only if both words found in a
Posted: Fri Jan 31, 2014 6:56 pm
I have 1000s of text files I need to search for a particular failure. All my text files contain a word I want to search but I only want it found if it is followed by a FAIL.
I do not want it to appear if it passes. Is there a way to do this?
Below I copied the format in which this test appears in my files. I only want my search to return tg_format_tb and FAIL if this test fails as below, otherwise I don't want the search to return anything for a particular file.
Testing TG->PE Timing Formats [pe_tg_format_tb]
Testing NRZ Format 5.0MHz Test (200 ns) with Edge Strobes
*FAIL 10060 PE1 142 b_7
Is it possible? I am not a software person, so coding anything is beyond me.
Appreciate your help.
I forgot there are several tests in a text file and there may be multiple fails. Is there a way to avoid all other fails?
Thank you
I do not want it to appear if it passes. Is there a way to do this?
Below I copied the format in which this test appears in my files. I only want my search to return tg_format_tb and FAIL if this test fails as below, otherwise I don't want the search to return anything for a particular file.
Testing TG->PE Timing Formats [pe_tg_format_tb]
Testing NRZ Format 5.0MHz Test (200 ns) with Edge Strobes
*FAIL 10060 PE1 142 b_7
Is it possible? I am not a software person, so coding anything is beyond me.
Appreciate your help.
I forgot there are several tests in a text file and there may be multiple fails. Is there a way to avoid all other fails?
Thank you