PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » File System » File » Bug #4792

File_CSV: Last column keeps line breaks

Details

Submitted2005-07-11 21:31 UTC
Fromrazzari at gmail dot com
Assigneddufuz
StatusClosed
PackageFile
PHP Version4.3.11
OSLinux
Roadmaps1.3.0a1

Comments

[2005-07-11 21:31 UTC] razzari at gmail dot com

Description:
------------
When reading a delimited text-file with File_CSV, the last column keeps the line break, and because of that I have to trim it. It happens with both Unix and Windows line breaks. Please see the reproduced code at the URL below.

Reproduce code:
---------------
http://dev.mkti.com.ar/cvam/MAIL/_test/file_csv_testcase_trim_last_line.php

Expected result:
----------------
All the fields in the row return a string with no line breaks, as there is no line break other than the line separator.
However the last field for each row keeps the line break after it, therefore forcing me to post-process the data.
This seems an obvious issue, so I must admit I'm inclined to think I've done something wrong.

Actual result:
--------------
A string with no line break at the end.