remoe empty lines, output csv file