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
Its not the Excel. Windows does recognize the formula, the data as a date and autocorrects. You have to change the Windows settings.
"Control Panel" (-> "Switch to Classic View") -> "Regional and Language Options" -> tab "Regional Options" -> "Customize..." -> tab "Numbers" -> And then change the symbols according to what you want.
http://www.pcreview.co.uk/forums/enable-disable-auto-convert-number-date-t3791902.html
It will work on your computer, if these settings are not changed for example on your customers' computer they will see dates instead of data.
While creating the string to be written to my CSV file in C# I had to format it this way:
"=\"" + myVariable + "\""
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:
HTH
(EXCEL 2007 and later)
Either:
Data > Get external data > From Text
Either way, you will be presented with import options, simply select each column containing dates and tell excel to format as "text" not "general".
In my case, "Sept8" in a csv file generated using R was converted into "8-Sept" by Excel 2013. The problem was solved by using write.xlsx2() function in the xlsx package to generate the output file in xlsx format, which can be loaded by Excel without unwanted conversion. So, if you are given a csv file, you can try loading it into R and converting it into xlsx using the write.xlsx2() function.
(EXCEL 2016 and later, actually I have not tried in older versions)