If you have to use a text file, then why not consider an INI file?

[nick]
line1=jdfjds
line2=jdfjds
line3=jdfjds
line4=jdfjds
line5=jdfjds

You can then do 5 writeini's... copy 4 to 5, 3 to 4, 2 to 3, 1 to 2, and create a new 1. Whatever you do, a hash table will still be considerably faster.

Note that you can do the same writeini idea by including a counter number on every nick... $nick1, $nick2, etc. Then, copy 4 to 5, 3 to 4, etc. That will probably be slower than the INI, though. And both are slower than the hash table.