ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   XLS to CSV Conversion - #'s convert to Date (https://www.excelbanter.com/excel-discussion-misc-queries/90774-xls-csv-conversion-s-convert-date.html)

wnagatani

XLS to CSV Conversion - #'s convert to Date
 
When I convert an XLS doc into CSV, I have one field that converts to a date
and I do not want it to. The format of the column is text but it does not
seem to matter. The numbers in the field are alpha-numeric, if they contain
an alpha, it does not convert ot a date, if it is just numeric, it converts
to a date. Here is an example of the values:

1-2006
1-1SR0

Help!

Gary''s Student

XLS to CSV Conversion - #'s convert to Date
 
1. open a fresh, empty worksheet
2. format cell A1 as text and enter 1-2006 in it
3. save the file as Book1.csv
4. exit Excel
5. open Book1.csv in NotePad
you should see 1-2006 just as you entered it.
6. close NotePad
7. open Book1.csv in Excel
you should see that Excel converts it to a date upon re-opening

Its not saving that's the problem; its re-opening.
--
Gary''s Student


"wnagatani" wrote:

When I convert an XLS doc into CSV, I have one field that converts to a date
and I do not want it to. The format of the column is text but it does not
seem to matter. The numbers in the field are alpha-numeric, if they contain
an alpha, it does not convert ot a date, if it is just numeric, it converts
to a date. Here is an example of the values:

1-2006
1-1SR0

Help!


Dave Peterson

XLS to CSV Conversion - #'s convert to Date
 
You sure it converted it to a date when the CSV file was created?

Did you use Notepad to verify the output or did you just re-import it to excel?



wnagatani wrote:

When I convert an XLS doc into CSV, I have one field that converts to a date
and I do not want it to. The format of the column is text but it does not
seem to matter. The numbers in the field are alpha-numeric, if they contain
an alpha, it does not convert ot a date, if it is just numeric, it converts
to a date. Here is an example of the values:

1-2006
1-1SR0

Help!


--

Dave Peterson

mrice

XLS to CSV Conversion - #'s convert to Date
 

You could try putting an apostrophe before the numbers to force Excel to
see the data as text.

e.g. 1-2006 becomes '1-2006


--
mrice

Research Scientist with many years of spreadsheet development experience
------------------------------------------------------------------------
mrice's Profile: http://www.excelforum.com/member.php...o&userid=10931
View this thread: http://www.excelforum.com/showthread...hreadid=545930


wnagatani

XLS to CSV Conversion - #'s convert to Date
 
Thanks, you are right.

Warren

"Gary''s Student" wrote:

1. open a fresh, empty worksheet
2. format cell A1 as text and enter 1-2006 in it
3. save the file as Book1.csv
4. exit Excel
5. open Book1.csv in NotePad
you should see 1-2006 just as you entered it.
6. close NotePad
7. open Book1.csv in Excel
you should see that Excel converts it to a date upon re-opening

Its not saving that's the problem; its re-opening.
--
Gary''s Student


"wnagatani" wrote:

When I convert an XLS doc into CSV, I have one field that converts to a date
and I do not want it to. The format of the column is text but it does not
seem to matter. The numbers in the field are alpha-numeric, if they contain
an alpha, it does not convert ot a date, if it is just numeric, it converts
to a date. Here is an example of the values:

1-2006
1-1SR0

Help!



All times are GMT +1. The time now is 11:54 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com