Hi, here is an example of input files.
File one :
111111111 Error 0 paaaaa d ffffffff
cv,m dserr
2 333 555555
this is a file 1 Error 0 first file
Second file:
looking for Error 1 in the file
asd 34 nmmmmmmmmmmmm errrrrr
dd m mmmmmmm Error 1 ;;;;;;;;;;;
I'm scanning files for specific lines (with 'Error 0' and "Error 1', If lines found I append them to lists and count matched lines.
I need to print only the last line from each list and the count number (of matched lines).
I'm using Try/Except to handle empty lists and having a problem with "print". The script I wrote prints only one Print statement, Confused I need to print a lot more than one.
If you'll run my snippet, it will print only ones.
I'm trying to print all the last elements from the lists and I cannot.
Thank you!
File one :
111111111 Error 0 paaaaa d ffffffff
cv,m dserr
2 333 555555
this is a file 1 Error 0 first file
Second file:
looking for Error 1 in the file
asd 34 nmmmmmmmmmmmm errrrrr
dd m mmmmmmm Error 1 ;;;;;;;;;;;
I'm scanning files for specific lines (with 'Error 0' and "Error 1', If lines found I append them to lists and count matched lines.
I need to print only the last line from each list and the count number (of matched lines).
I'm using Try/Except to handle empty lists and having a problem with "print". The script I wrote prints only one Print statement, Confused I need to print a lot more than one.
If you'll run my snippet, it will print only ones.
I'm trying to print all the last elements from the lists and I cannot.
Thank you!