I cannot read the entire file, 500-600 MB in size, since this data is loaded into RAM, for me it is too expensive.
I read the file
file_get_content 'with a limit of lines (conditionally on 1000 lines). How do I then say delete specific lines. Without using
$f = file .
Details: I read a very large file of 1000 lines (the first 1000 lines), I process them in my own way and depending on the conditions, some lines need to be deleted, and some left.
I can write the result to a temporary file, and what if the script stops or something else, but there is no possibility of rollback.