I was asked to write a program to find string "error" from a file and print matched lines in python.
- Will first open a file with read more
- i use fh.readlines and store it in a variable
- After this, will use for loop and iterate line by line. check for the string "error".print those lines if found.
I was asked to use pointers in python since assigning file content to a variable consumes time when logfile contains huge output.
I did research on python pointers. But not found anything useful. Could anyone help me out writing the above code using pointers instead of storing the whole content in a variable.