TSV文件末尾的空行在MySQL加载数据Infile中创建空列

What's the best way to amend this issue, in either MySQL or PHP?

I'm using the Amazon PHP SDK, GetReport function.

$intry  = (stream_get_contents($request->getReport()) . "
");
$merchantalldata = '_GET_MERCHANT_LISTINGS_ALL_DATA_' . $today0 . '.tsv';
file_put_contents($merchantalldata,$intry);

$sql = "LOAD DATA LOCAL INFILE '_GET_MERCHANT_LISTINGS_ALL_DATA_" . $today00 . ".tsv' INTO TABLE . . . . "

Always on my returned TSV, it's always the same:

enter image description hereenter image description here

How can I fix this issue, whether in the TSV file itself, via PHP, or disallow this blank entry from being inserted in the MySQL database?

Remove the " " in the stream_get_contents() call, then trim() if needed:

$intry = trim(stream_get_contents($request->getReport()));