tail csv reading and writing