Stop Excel from automatically converting certain text values to dates

前端 未结 30 3199
别跟我提以往
别跟我提以往 2020-11-22 04:16

Does anyone happen to know if there is a token I can add to my csv for a certain field so Excel doesn\'t try to convert it to a date?

I\'m trying to write a .csv fil

30条回答
  •  猫巷女王i
    2020-11-22 04:50

    Still an issue in Microsoft Office 2016 release, rather disturbing for those of us working with gene names such as MARC1, MARCH1, SEPT1 etc. The solution I've found to be the most practical after generating a ".csv" file in R, that will then be opened/shared with Excel users:

    1. Open the CSV file as text (notepad)
    2. Copy it (ctrl+a, ctrl+c).
    3. Paste it in a new excel sheet -it will all paste in one column as long text strings.
    4. Choose/select this column.
    5. Go to Data- "Text to columns...", on the window opened choose "delimited" (next). Check that "comma" is marked (marking it will already show the separation of the data to columns below) (next), in this window you can choose the column you want and mark it as text (instead of general) (Finish).

    HTH

提交回复
热议问题