是否可以在 iPad 上的 CSV 文件中使用双引号?
我在 iPad 移动浏览器上使用特殊的 CSV 解释器(不知道它叫什么)时遇到问题。
iPad 似乎将字符 "
保留为保留或特殊字符。当出现此字符时,字符串将被视为文字,而不是作为 CSV 分隔。
输入:
1111,64-1111-11,一些工具 12", 112233
给出上面的输入,CSV mobile-safari 显示显示([] 代表一列)
[1111] [64-1111-11] [某些工具 12, 112233]
请注意,缺少 "
。另请注意,112233
不像它那样位于其自己的列中应该是。
问题 2:
如何让 safari 中的 CSV 显示工具不将六位数字视为电话号码?
1234567
显示为超链接,单击它时要求“添加联系人”。我不想要超链接。
UPDATE
iPad is ignoring the escape character (or backslash is not the escape character) for double quotes in CSV files. I am looking at the hex version of the file and I have
\" 或 5C 22 (采用 UTF-8 编码的十六进制)。
不幸的是,iPad 显示反斜杠,但仍将 "
视为特殊字符,从而破坏了我的数据格式。有人知道我如何在 iPad CSV 上使用 "
吗?
I am having issues with the special CSV interpreter (no idea what its called) on iPad mobile browser.
iPad appears to reserve the character "
as reserved or special. When this character appears the string is treated as a literal instead of seperated as a CSV.
INPUT:
1111,64-1111-11,Some Tool 12", 112233
Give the input above, the CSV mobile-safari display shows ([] represents a column)
[1111] [64-1111-11] [Some Tool 12, 112233]
Note that the "
is missing. Also note that 112233
is not in its own column like it should be.
Question 2:
How can I get the CSV display tool in safari to not treat a six digit number as a phone number?
1234567
Shows up as a hyperlink and asks to "Add Contact" when I click it. I do not want the hyperlink.
UPDATE
iPad is ignoring the escape character (or backslash is not the escape character) for double quotes in CSV files. I am looking at the hex version of the file and I have
\" or 5C 22 (in hex with UTF-8 encoding).
Unfortuntely, the iPad displays the backslash and still treats "
as a special character, thereby corrupting my data formatting. Anybody know how I can possibly use "
on iPad CSV?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
关于引号,您是否尝试过在输出中转义它们?
编辑:传统转义不适用于 CSV 文件,抱歉。大多数规格说明如下:
因此,在您的 CSV 片段上进行测试,文件格式如下:
或者甚至像这样:
… 在 Mobile Safari 中打开,OK。您需要检查一下 Excel 中的效果是好是坏。
转到第二个问题,要防止 Mobile Safari 将号码显示为电话号码,请将其添加到页面的
head
元素中:With regards the quotes, have you tried escaping them in the output?
EDIT: conventional escaping doesn't work for CSV files, my apologies. Most specifications state the following:
So, testing this on your CSV snippet, a file formatted like this:
or even like this:
… opens in Mobile Safari OK. How good or bad that looks in Excel you'd need to check.
Moving to the second issue, to prevent Mobile Safari from presenting numbers as phone numbers, add this to your page's
head
element: