You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We allow persons to copy/paste data from excel into a text input, which we then create a CSV object.
For example, if they copy in
the rtrim() on createFromString() would remove the final tab character, effectively removing the empty column in the last row.
I don't believe the trim here is a good idea.
The work arounds are:
applying the second parameter, $newline, to be "\t\n" - however if data is provided with the last cell filled, then i've needlessly added an extra column. Solution: i have to read the last character of $str to check if it is a tab, and if so, update the $newline to "\t\n" otherwise leave it as "\n"
I don't believe the rtrim is necessary, as the application should match the user's representation of data as closely as possible. I think the better option would be to add trim() as an option on the object, $reader->rtrimIncomingString(true)
thoughts?
The text was updated successfully, but these errors were encountered:
Thanks for reporting this bug. As a matter of fact, this one is being fixed as part of the 7.2.0 release that will be out hopefully this week if I still have time or next week. The change will be in the master branch anyway. This is fixed as part of resolving SplFileObject flags bugs see #131
The $newline parameter is being deprecated from the createFromString method and will be remove completely in the next major release.
Hi,
I have a concern with the trim on instantiation.
We allow persons to copy/paste data from excel into a text input, which we then create a CSV object.
For example, if they copy in
the rtrim() on createFromString() would remove the final tab character, effectively removing the empty column in the last row.
I don't believe the trim here is a good idea.
The work arounds are:
I don't believe the rtrim is necessary, as the application should match the user's representation of data as closely as possible. I think the better option would be to add trim() as an option on the object, $reader->rtrimIncomingString(true)
thoughts?
The text was updated successfully, but these errors were encountered: