regular expressions

Terry Reedy tjreedy at udel.edu
Thu Apr 15 12:05:31 EDT 2010


On 4/15/2010 2:57 AM, chaaana wrote:
> hi..
> im parsing the text file containing the details of the testcases
> failed.From the file i wanted to obtain only the testcase names and
> enter them in the excel sheet.
>
> the pattern of the text file is:
>
> FILE : NW_PTH_TFG6_SCEN_4_2_FIFO.c, LINE : 240 TEST FAIL to get entire:
> 32768 bytes
> NW_PTH_TFG6_SCEN_4_2_FIFO.c 340 DATA NOT MATCHING, TEST FAIL
> TEST FAIL SYSCALL_TEST_SCEN_4_1_ALL.c at line 355
> FILE:US_TFG7_SCEN_4_1.c,LINE:189, Server side TEST FAIL
> FAIL BREW_SCEN_4_1.c 219: can't mount
> FAIL BREW_SCEN_4_1.c 121: can't umount
> <<  BREW_SCEN_4_1.c TEST FAIL errno:No such file or directory>>
> <<  BREW_SCEN_4_1.c TEST FAIL>>  error:Invalid argument

I do not see any consistent pattern in the above lines.
What output do you see from filtering them?

> i used the ' re module' and its function partition,but im facing
> problem in obtaining only the testcase names..

If I could not write a satisfactory re, I would be tempted to write 
explicit code to process the lines, possibly defining appropriate search 
states.

Terry Jan Reedy




More information about the Python-list mailing list