-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
newline handling in restframework csv #82
Comments
I work with @drake01. Here's an example file, saved from Excel for Mac:
In use: >>> print(CSVParser().parse(data))
# expected/desired output
[{'kingdom': 'plant', 'keywords': 'leaves\nroots\nflowers'}]
# actual output
[{'kingdom': 'plant', 'keywords': 'leavesrootsflowers'}] |
Thanks a lot for this example @cvn. |
Looks like this is a duplicate of #24. |
We were able to create new Parser class derived from In parse method, stream data can be split using: Anyone facing this issue can use it. |
Hi,
As I understand csv parser removes newline characters here: https://github.com/mjumbewu/django-rest-framework-csv/blob/master/rest_framework_csv/parsers.py#L25-L26
Lets say there a cell in csv where value is something like:
'''
Nature
Foliage
Trees
'''
Now we want to parse this particular cell as ["Nature", "Foliage", "Trees"] But with current parser code we can't? because after splitlines() the cell becomes "NatureFoliageTrees"?
Is there a way to handle the issue I am facing?
The text was updated successfully, but these errors were encountered: