There are two functions that you should familiarize yourself with.
The first file() , which reads the entire file into an array, with each line being an element of the array. This is useful for shorter files, and probably this is not what you want to use in a 100k file. This function handles its own file management, so you do not need to explicitly open and close the file yourself.
The second is fgets() , which you can use to read the file one line at a time. You can use this for a loop as long as there are more lines to process, and follow your processing line inside the loop. You will need to use fopen() to get the file descriptor, you can track the file pointer yourself to control recovery (i.e. you wonβt have to restart processing from scratch if something goes sideways and the script fails), etc. .
Hope this is enough to get you started.
AgentConundrum
source share