Hi!
If you open a file for append then the filepointer points behind the last char of the textfile.
The you try to read from this file - but there is nothing to read.
This results in runerror 5.
Solution: create for every file a second stringlist.
Read the last line.
If it is = 'time_tag,A7_QUAL_FLAG,A7_COUNT_RATE,A ....'
then continue as in your code,.
Free the second stringlist.
Winni