Thanks for the hint.
I was poking around with fileTell &fileSeek, but it seemed too complicated to open a file then copy all the data until the 5th last line was reached. I can't even figure out, howto check if EOF is rechead within a while-loop or so.
Maybe there is a better solution for my problem:
I need to read and write some values into a config file like the windows ini-files: