open inputfile for reading open outputfile for writing while get a line from inputfile split it into fields if the 8th field is >= -10 and <= 10 print the line to outputfile close the files move outputfile to inputfile