There are some pitfalls related to opening a TEXT file directly by Excel. Excel trys to be helpful and can CONVERT, that is CHANGE, some data. Some of that is probably what is intended, because if you have a date in your text file, remembering that it is JUST A STRING OF CHARACTERS, Excel 'recognizes' or 'assumes' that this STRING is intended to be a date and CONVERTS it to a NUMBER and FORMATS the display as a date.
For instance here's a .csv file data
[tt]
Date1,Date2,Date3
2012/08/31,8/31/2012,31/8/2012
[/tt]
Here's the data as OPENED in excel
Code:
Date1 Date2 Date3
8/31/2012 8/31/2012 31/8/2012
where Date1 & Date2 are REAL DATES and Date3 is JUST TEXT! Notice that m/dd/yyyy is Excel's default FORMAT position, regardless of the structure of the source data. This is reflected by the fact that then d/m/yyyy structure is an INCORRECT input structure.
I will be able to defeat that problem, if I use the IMPORT EXTERNAL DATA feature, by IMPORTING the .csv data into an EXISTING Excel sheet. I can discretely specify that the import parsing spec for column A is YMN, column B is MDY and column C is DMY.
Another problem comes with data that is really TEXT but contains ALL DIGITS. This sort of data is a category that we might call IDENTIFIER (Part Numbers, Invoice Numbers, ZIP Codes etc) where the LENGTH of the string might be significant or leading ZEROS might be significant, and that would NEVER be used in math. When you OPEN the .csv with this kind of data, the DIGITS are converted to NUMERIC data and store that way. When you IMPORT, you can specify that column of data to be TEXT, and it will be maintained as TEXT.
Further issues can affect data that APPEARS to be Scientific Notation, like 171E2. In one of my systems, this is a Machine Identifier. When I OPEN in Excel it CONVERTS this value to the NUMBER, 1.71E+04 or 17100. Again, using the IMPORT feature, I can specify the import type of the column to be TEXT.
BOTTOM LINE: BEWARE opening text file directly in Excel. You can be bitten!
Skip,
Just traded in my old subtlety...
for a NUANCE!![[tongue] [tongue] [tongue]](/data/assets/smilies/tongue.gif)