google docs spreadsheet export: How to remove apostrophe from times, dates [closed]

巧了我就是萌 提交于 2021-02-11 15:09:56

问题


I'm exporting a spreadsheet from Google Docs as CSV, and there are apostrophe's (') prepended to each date and time value. This is really annoying as OpenOffice doesn't seem to be able to find/replace these in the spreadsheet editor.

I could solve the problem by opening the CSV file as text and replacing the chars that way, but it seems like there has to be a way to prevent the issue in the first place. Anyone know of a way to fix this? (Removing them during the OO file import would also be an acceptable solution.)


回答1:


The apostrophe isn't really part of the cell content, it just signifies that the cell is formatted as text. To reenter all the data as number:

  1. Highlight all of the cells and use Format -> Cells to change the cell format to an appropriate number format.

  2. With all of the cells still selected, go to the menu Edit -> Find & Replace

  3. In the Search For box enter .* (period asterisk)

  4. In the Replace with box enter &

  5. Select More Options and check Current Selection Only and Regular Expressions

  6. Click Replace All

The .* "means zero or more of any character" and & means "whatever was found". These are regular expressions which are explained in the help section

Source




回答2:


It turns out the the CSV file itself didn't have the apostrophes in the data, but they were being added by OpenOffice Calc during the import. Checking the selection marked "Detect special numbers" prevented this modification, but then converted the values to specific formatting that can be handled within the Spreadsheet view. Still not an ideal solution, but clearly the issue centers on OpenOffice Calc rather than Google Docs.



来源:https://stackoverflow.com/questions/14186580/google-docs-spreadsheet-export-how-to-remove-apostrophe-from-times-dates

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!