Leave out quotes when copying from cell

后端 未结 13 1124
情话喂你
情话喂你 2020-12-01 04:16

Problem:
When copying a cell from Excel outside of the program, double-quotes are added automatically.

Details:
I\'m using

13条回答
  •  执念已碎
    2020-12-01 04:28

    Note:The cause of the quotes is that when data moves from excel to clipboard it is fully complying with CSV standards which include quoting values that include tabs, new lines etc (and double-quote characters are replaced with two double-quote characters )

    So another approach, especially as in OP's case when tabs/new lines are due to the formula, is to use alternate characters for tabs and hard returns. I use ascii Unit Separator =char(31) for tabs and ascii Record Separator =char(30) for new lines.

    Then pasting into text editor will not involve the extra CSV rules and you can do a quick search and replace to convert them back again.

    If the tabs/new lines are embedded in the data, you can do a search and replace in excel to convert them.

    Whether using formula or changing the data, the key to choosing delimiters is never use characters that can be in the actual data. This is why I recommend the low level ascii characters.

提交回复
热议问题