My task is to open a large file in READ&WRITE mode and i need to search some portion of text in that file by searching starting and end
Does your search pattern match more than one line? If not then the easiest solution is to read line by line :). Simple really
But if the search pattern matches multiple lines then you need to let us know because searching line by line will not work.