-
Notifications
You must be signed in to change notification settings - Fork 992
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
fread: quotes in quoted string fields #1299
Comments
@berndbischl w.r.t. the doubled slashes, I don't see a difference with I'm working on |
duplicate of #1109 ? |
@arunsrinivasan
Output:
Like I said, the quoting backslashes get doubled for fread. For ref, sessionInfo
|
I tried this better code:
Both calls dont do what I want, that is to obtain the content of s. NB: that still both call produce different results. |
To read it with # 1299_fread.csv
"a","b"
"x","my name is "joe""
fread("1299_fread.csv")
# V1 V2
# 1: a b
# 2: x my name is "joe" I'm not particularly fond of the behaviour of See In short, if you've to use |
This'll be solved if/when #1109 is implemented ( |
I tried to address this in my first post. As far as I understand the docs that does not work, when I now have commas and so on in my string after the quotes? And the quotes need to be balanced? |
Because if that is they case, I cannot use this. And this issue is still open. Like I said, I have no control about the contents of the string, they can be very general. Can you please comment on this so I know whether this is solved or not? |
I don't know what this means.
From
Did you go through this? If so, why wouldn't it work in your case? Please show with an example. I'm not sure why you think it should be open. Your issue is about "" being not escaped in the read file, which would be solved when/if |
MOVED to #1109 |
Most of your points are on escaping quotes (which should be handled better). But could you please shift this post to #1109? |
Hi,
how do I properly encode / import string fields with double quotes in them?
The docs say:
Due to the restrictions on unquoted char cols, my cols are always quoted (a sep can appear in them)
Due to the restrictions on "normal dquotes" inside of the string, I have to escape them.
Now the problem is that this is imported correctly, as I want it:
See here
But this is what I have to use, but the backslashes used for quoting the extra dquotes now get doubled
File:
fread output:
Note: I have some control over the csv files, as I am already preprocessing them a bit. But I need a routine that works on general files, so in my string columns I have to expect arbitrary input.
The text was updated successfully, but these errors were encountered: