file funtion ,count number of rows