As per the answers to this question: Stop Excel from automatically converting certain text values to dates I am trying to create a CSV file using the csv module of python, with certain fields formatted as
"=""<string-that-looks-like-a-date>"
however I am being unable to get the CSV writer to generate output like that. If I use the default csvwriter (no special parameters), and pre-format my data, it tries to quote all my quotes, and I get output that looks like this:
"""=""""6/6"""
If I set the quoting level of the csv writer to QUOTE_NONE, then I get an "Error: need to escape, but no escape char set". Explicitly setting an escape character causes all the quotes I put in to be escaped. Trying just adding an equal sign to my data results in excel showing
=<string_that_looks_like_a_date>
And so it goes - every combination of Quoting and formatting data I have tried fails to output the desired format.
Is there any way to get the python csvwriter module to output something that excel will interpret as plain text without any extra characters showing up in excel?