Thanks apronk it now works for the first entry but then the counter does not seem to go up. I have checked and the file ends with a CRLF