PHP header text/csv unwanted line feed character

We have successfully created a comma delimited file, the results are correct from an sql database query. When using the following headers to print the file using print $data, an extra line feed is added and a blank row appears on the top of the data in Excel:

    header("Expires: 0");
    header("Cache-Control: private");
    header("Pragma: cache");
    header("Content-type: text/csv");    
    header("Content-Disposition: attachment; filename=test.csv");
    print $data;

Note: this character is not in $data itself, but appears after the above headers are sent. Does anyone know why this new line feed character is added and how to remove? Thanks in advance for your help.