Mail is likely the default email app on your Mac, but just in case you have others downloaded, you can set the default reader. Here's how: Launch Mail from your dock or the Finder. Click Mail in the menu bar at the top of the screen. Click Preferences. Click the dropdown next to Default Mail Reader. Click the app you'd like to set as the default.
Active7 months ago
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 file from my application and one of the values happens to look enough like a date that Excel is automatically converting it from text to a date. I've tried putting all of my text fields (including the one that looks like a date) within double quotes, but that has no effect.
JimmyPena
7,96655 gold badges3737 silver badges5959 bronze badges
user16324
34 Answers
12 next
I have found that putting an '=' before the double quotes will accomplish what you want. It forces the data to be text.
eg. ='2008-10-03',='more text'
EDIT (according to other posts): because of the Excel 2007 bug noted by Jeffiekins one should use the solution proposed by Andrew:
'='2008-10-03''
Community♦
Jarod ElliottJarod Elliott
13.4k22 gold badges3030 silver badges3333 bronze badges
I know this is an old question, but the problem is not going away soon. CSV files are easy to generate from most programming languages, rather small, human-readable in a crunch with a plain text editor, and ubiquitous.
The problem is not only with dates in text fields, but anything numeric also gets converted from text to numbers. A couple of examples where this is problematic:
which sometimes can start with one or more zeroes (0), which get thrown away when converted to numeric. Or the value contains characters that can be confused with mathematical operators (as in dates: /, -).
Two cases that I can think of that the 'prepending =' solution, as mentioned previously, might not be ideal is
If one pre/appends a non-numeric and/or non-date character in the value, the value will be recognized as text and not converted. A non-printing character would be good as it will not alter the displayed value. However, the plain old space character (s, ASCII 32) doesn't work for this as it gets chopped off by Excel and then the value still gets converted. But there are various other printing and non-printing space characters that will work well. The easiest however is to append (add after) the simple tab character (t, ASCII 9).
Benefits of this approach:
Best free program for photo editiing a tiff file on a mac. If there's a reason you don't want to use the tab, look in an Unicode table for something else suitable.
might be to generate XML files, for which a certain format also is accepted for import by newer MS Excel versions, and which allows a lot more options similar to .XLS format, but I don't have experience with this.
Best language to program for mac. So there are various options. Depending on your requirements/application, one might be better than another.
It needs to be said that newer versions (2013+) of MS Excel don't open the CSV in spreadsheet format any more - one more speedbump in one's workflow making Excel less useful.. At least, instructions exist for getting around it. Best computer drawing program for mac. See e.g. this Stackoverflow: How to correctly display .csv files within Excel 2013?.
fr13dfr13d
2,23211 gold badge1212 silver badges1414 bronze badges
Working off of Jarod's solution and the issue brought up by Jeffiekins, you could modify
to
Andrew FerkAndrew Ferk
I had a similar problem and this is the workaround that helped me without having to edit the csv file contents:
If you have the flexibility to name the file something other than '.csv', you can name it with a '.txt' extension, such as 'Myfile.txt' or 'Myfile.csv.txt'. Then when you open it in Excel (not by drag and drop, but using File->Open or the Most Recently Used files list), Excel will provide you with a 'Text Import Wizard'.
In the first page of the wizard, choose 'Delimited' for the file type.
In the second page of the wizard choose ',' as the delimiter and also choose the text qualifier if you have surrounded your values by quotes
In the third page, select every column individually and assign each the type 'Text' instead of 'General' to stop Excel from messing with your data.
Hope this helps you or someone with a similar problem!
rainerbitrainerbit
WARNING: Excel '07 (at least) has a(nother) bug: if there's a comma in the contents of a field, it doesn't parse the ='field, contents' correctly, but rather puts everything after the comma into the following field, regardless of the quotation marks.
The only workaround I've found that works is to eliminate the = when the field contents include a comma.
This may mean that there are some fields that are impossible to represent exactly 'right' in Excel, but by now I trust no-one is too surprised.
JeffiekinsJeffiekins
While creating the string to be written to my CSV file in C# I had to format it this way:
Colin PearColin Pear
2,58711 gold badge2424 silver badges3131 bronze badges
In Excel 2010 open a new sheet.On the Data ribbon click 'Get External Data From Text'.Select your CSV file then click 'Open'.Click 'Next'.Uncheck 'Tab', place a check mark next to 'Comma', then click 'Next'.Click anywhere on the first column.While holding the shift key drag the slider across until you can click in the last column, then release the shift key.Click the 'text' radio button then click 'Finish'
All columns will be imported as text, just as they were in the CSV file.
Rob StockleyRob Stockley
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
Ana Maria Mendes-PereiraAna Maria Mendes-Pereira
Here is the simple method we use at work here when generating the csv file in the first place, it does change the values a bit so it is not suitable in all applications:
Prepend a space to all values in the csv
This space will get stripped off by excel from numbers such as ' 1',' 2.3' and ' -2.9e4' but will remain on dates like ' 01/10/1993' and booleans like ' TRUE', stopping them being converted into excel's internal data types.
It also stops double quotes being zapped on read in, so a foolproof way of making text in a csv remain unchanged by excel EVEN IF is some text like '3.1415' is to surround it with double quotes AND prepend the whole string with a space, i.e. (using single quotes to show what you would type) ' '3.1415'. Then in excel you always have the original string, except it is surrounded by double quotes and prepended by a space so you need to account for those in any formulas etc.
DanDan
(Assuming Excel 2003..)
When using the Text-to-Columns Wizard has, in Step 3 you can dictate the data type for each of the columns. Click on the column in the preview and change the misbehaving column from 'General' to 'Text.'
DocMaxDocMax
10.6k44 gold badges3434 silver badges3838 bronze badges
This is a only way I know how to accomplish this without messing inside the file itself. As usual with Excel, I learned this by beating my head on the desk for hours.
Change the .csv file extension to .txt; this will stop Excel from auto-converting the file when it's opened. Here's how I do it: open Excel to a blank worksheet, close the blank sheet, then File => Open and choose your file with the .txt extension. This forces Excel to open the 'Text Import Wizard' where it'll ask you questions about how you want it to interpret the file. First you choose your delimiter (comma, tab, etc..), then (here's the important part) you choose a set columns of columns and select the formatting. If you want exactly what's in the file then choose 'Text' and Excel will display just what's between the delimiters.
Jonathan Leffler
593k9898 gold badges711711 silver badges10681068 bronze badges
ChrisChris
2018
The only proper solution that worked for me (and also without modifying the CSV).
Excel 2010:
Excel office365: (client version)
Note: Excel office365 (web version), as I'm writing this, you will not be able to do that.
evilReikoevilReiko
9,1191515 gold badges6565 silver badges8181 bronze badges
(EXCEL 2007 and later)
How to force excel not to 'detect' date formats without editing the source file
Either:
Either way, you will be presented with import options, simply select each column containing dates and tell excel to format as 'text' not 'general'.
Some_GuySome_Guy
None of the solutions offered here is a good solution. It may work for individual cases, but only if you're in control of the final display. Take my example: my work produces list of products they sell to retail. This is in CSV format and contain part-codes, some of them start with zero's, set by manufacturers (not under our control). Take away the leading zeroes and you may actually match another product. Retail customers want the list in CSV format because of back-end processing programs, that are also out of our control and different per customer, so we cannot change the format of the CSV files. No prefixed'=', nor added tabs. The data in the raw CSV files is correct; it's when customers open those files in Excel the problems start. And many customers are not really computer savvy. They can just about open and save an email attachment.We are thinking of providing the data in two slightly different formats: one as Excel Friendly (using the options suggested above by adding a TAB, the other one as the 'master'. But this may be wishful thinking as some customers will not understand why we need to do this. Meanwhile we continue to keep explaining why they sometimes see 'wrong' data in their spreadsheets.Until Microsoft makes a proper change I see no proper resolution to this, as long as one has no control over how end-users use the files.
mljmmljm
I have jus this week come across this convention, which seems to be an excellent approach, but I cannot find it referenced anywhere. Is anyone familiar with it? Can you cite a source for it? I have not looked for hours and hours but am hoping someone will recognize this approach.
Example 1: =('012345678905') displays as 012345678905
Example 2: =('1954-12-12') displays as 1954-12-12, not 12/12/1954.
GW4GW4
What I have done for this same problem was to add the following before each csv value:'=''and one double quote after each CSV value, before opening the file in Excel. Take the following values for example:
These should be altered before opening in Excel to:
After you do this, every cell value appears as a formula in Excel and so won't be formatted as a number, date, etc. For example, a value of 012345 appears as:
ChrisBChrisB
1,14133 gold badges1111 silver badges3838 bronze badges
Its not the Excel. How to do blank program insert in microsoft word for mac. 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 LanguageOptions' -> tab 'Regional Options' -> 'Customize..' -> tab 'Numbers' -> Andthen change the symbols according to what you want.
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.
syandrassyandras
Hi I have the same issue,
I write this vbscipt to create another CSV file. The new CSV file will have a space in font of each field, so excel will understand it as text.
So you create a .vbs file with the code below (for example Modify_CSV.vbs), save and close it. Drag and Drop your original file to your vbscript file. It will create a new file with 'SPACE_ADDED' to file name in the same location.
Zarepheth
1,66122 gold badges1818 silver badges4343 bronze badges
Harry DuongHarry Duong
Without modifying your csv file you can:
excel will properly format and separate your csv cells as text formatted ignoring auto date formats.
Kind of a silly work around, but it beats modifying the csv data before importing. Andy Baird and Richard sort of eluded to this method, but missed a couple important steps.
cliffclofcliffclof
I know this is an old thread. For the ones like me, who still have this problem using office 2013 via powershell com object can use the opentext method. The problem is that this method has many arguments, that are sometimes mutual exclusive. To resolve this issue you can use the invoke-namedparameter method introduced in this post.An example would be
Unfortunately I just discovered that this method somehow breaks the csv parsing when cells contain linebreaks. This is supported by csv but microsofts implementation seems to be bugged.Also it did somehow not detect german specific chars. Giving it the correct culture did not change this behaveiour. All files (csv and script) are saved with utf8 encoding. First I wrote the following code to insert the csv cell by cell.
But this is extremly slow, which is why i looked for an alternative. Appearently Excel allows you to set the values of a range of cells with a matrix. So i used the algorithm in this blog to transform the csv in a multiarray.
You can use above code as is it should convert any csvs into excel. Just change the path to the csv and the delimiter character at the bottom.
Community♦
flatbeatflatbeat
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.
Dinghai ZhengDinghai Zheng
A workaround using Google Drive (or Numbers if you're on a Mac):
![]()
Alternatively if you're on a Mac for step 3 you can open the data in Numbers.
Derek HillDerek Hill
2,23011 gold badge3333 silver badges5555 bronze badges
(EXCEL 2016 and later, actually I have not tried in older versions)
Roman YakovivRoman Yakoviv
Okay found a simple way to do this in Excel 2003 through 2007. Open a blank xls workbook. Then go to Data menu, import external data. Select your csv file. Go through the wizard and then in 'column data format' select any column that needs to be forced to 'text'. This will import that entire column as a text format preventing Excel from trying to treat any specific cells as a date.
RichardRichard
This issue is still present in Mac Office 2011 and Office 2013, I cannot prevent it happening. It seems such a basic thing.
In my case I had values such as '1 - 2' & '7 - 12' within the CSV enclosed correctly within inverted commas, this automatically converts to a date within excel, if you try subsequently convert it to just plain text you would get a number representation of the date such as 43768. Additionally it reformats large numbers found in barcodes and EAN numbers to 123E+ numbers again which cannot be converted back.
I have found that Google Drive's Google Sheets doesnt convert the numbers to dates. The barcodes do have commas in them every 3 characters but these are easily removed. It handles CSVs really well especially when dealing with MAC / Windows CSVs.
Might save someone sometime.
EricNo7EricNo7
EASIEST SOLUTIONI just figured this out today.
Once you are done editing, you can always open it back up in Word again to replace the en dashes with hyphens again.
Randy HoffmanRandy Hoffman
I do this for credit card numbers which keep converting to scientific notation: I end up importing my .csv into Google Sheets. The import options now allow to disable automatic formatting of numeric values. I set any sensitive columns to Plain Text and download as xlsx.
It's a terrible workflow, but at least my values are left the way they should be.
BrendonwbrownBrendonwbrown
I made this vba macro which basically formats the output range as text before pasting the numbers. Works perfect for me when i want to paste values such as 8/11, 23/6, 1/3 etc. without Excel interpreting them as dates.
I'm very interested in knowing if this works for other people as well. I've been looking for a solution to this problem for a while, but I haven't seen a quick vba solution to it before which didn't include inserting ' in front of the input text. This code retains the data in its original form.
LarsSLarsS
If you put an inverted comma at the start of the field, it will be interpreted as text.
Example:
25/12/2008 becomes '25/12/2008
![]()
You are also able to select the field type when importing.
Harley HolcombeHarley Holcombe
125k1515 gold badges6565 silver badges6262 bronze badges
An alternate method:
Convert the format of the column you want to change to 'Text'. Select all the cells you want to preserve, copy. Without deselecting those columns, click 'Edit > Paste Special > As values'
Save as CSV. Note that this has to be the last thing you do to the file because when you reopen it, it will format itself as dates since cell formats cannot be saved in CSV files.
Andy BairdAndy Baird
3,60744 gold badges3535 silver badges5858 bronze badges
protected by Community♦Jun 8 '16 at 22:34
Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead? Related Articles
Microsoft Excel provides a way for you to personalize the spreadsheets your business uses to your liking and save those customizations as the standard default settings. At some point, if you want to revert back to the factory default settings of the spreadsheet program -- to pass your computer on to another worker, for example -- Excel enables you to do that as well through a couple options.
Yahoo Mail Default ProgramDisable Add-Ins2.
Click 'Options' under Help to open the Options dialog box.
3.
Click 'Trust Center' and then 'Trust Center Settings.'
4.
Click 'Add-ins' in the left pane if the window opens to a different heading.
5.
Check the box next to 'Disable all Application Add-ins (may impair functionality).'
Repair ExcelSet Default Program1.
Click the Start button and open the 'Control Panel.'
2.
Click the 'Uninstall a program' link under Programs.
4.
Click the 'Change' button and wait for a new window to open.
5.
Click to select the 'Repair' option and click 'Continue' to authorize your computer to repair Microsoft Excel to its default settings.
References (2)How Do I Make Excel My DefaultAbout the Author
Lana Gates has been writing and editing for more than 20 years. Her articles have been published in 'Software Magazine,' 'Computerworld,' 'Application Development Trends,' 'Contract Professional,' Sourcingmag.com, 'Hearts at Home,' 'Gilbert Lifestyle,' 'Senior Lifestyle' and 'Phoenix Rising: The Making of a Desert Metropolis.' Gates graduated from Colorado Christian University with a B.A. in communications.
Cite this Article
Choose Citation Style
Gates, Lana. 'How to Restore Microsoft Excel to Its Default Spreadsheet.' Small Business - Chron.com, http://smallbusiness.chron.com/restore-microsoft-excel-its-default-spreadsheet-42283.html. Accessed 07 September 2019.
Gates, Lana. (n.d.). How to Restore Microsoft Excel to Its Default Spreadsheet. Small Business - Chron.com. Retrieved from http://smallbusiness.chron.com/restore-microsoft-excel-its-default-spreadsheet-42283.html
Gates, Lana. 'How to Restore Microsoft Excel to Its Default Spreadsheet' accessed September 07, 2019. http://smallbusiness.chron.com/restore-microsoft-excel-its-default-spreadsheet-42283.html
Note: Depending on which text editor you're pasting into, you might have to add the italics to the site name.
Comments are closed.
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |