Hey There,

I would need some help with my textfile processing.

Following situation:
Textfile with around 20.000 lines.
(every line contains a msg message)

My script is Processing as follows:

1) read the first line from txt (with read command)
2) delete the first line from txt (with write command)
3) if the txt file is not empty start again with 1) (in a loop)
4) if the txt file is empty - halt

Issue:
I think the issue which i provide as follows comes from the txt file size.

At the beginning of the processing the script only reads 3-5 lines per second.
Later it is getting faster and faster up to 20-40 lines per second.

Is there a way to process large text files faster?