read data first, then output the first line