PC Review


Reply
Thread Tools Rate Thread

why csv fields converted into dates

 
 
hilz
Guest
Posts: n/a
 
      4th Oct 2005
Hi
I have a csv file with fields that look like this

,"20-10",

this is being interpreted as a date when i open it in Excel.
what do i need to do with this filed in order to make Excel consider it
a text?
I tried replacing the double quotes with a single quote like this:

,'20-10',

but that makes the single quote appear in the cell in Excel, which is
not what i want.


please help.
thanks
 
Reply With Quote
 
 
 
 
Bucky
Guest
Posts: n/a
 
      4th Oct 2005
hilz wrote:
> I have a csv file with fields that look like this
> ,"20-10",
> this is being interpreted as a date when i open it in Excel.


Hmm, that's strange, Excel kept it as text when I opened a test file. I
have 2003, what version are you using?

 
Reply With Quote
 
David McRitchie
Guest
Posts: n/a
 
      4th Oct 2005
I get a date in Excel 2001 with 20/10 or with 20-10

I think Excel 2003 has some options on not treating everything
as a date. Transition options could also come into play.
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Bucky" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> hilz wrote:
> > I have a csv file with fields that look like this
> > ,"20-10",
> > this is being interpreted as a date when i open it in Excel.

>
> Hmm, that's strange, Excel kept it as text when I opened a test file. I
> have 2003, what version are you using?
>



 
Reply With Quote
 
hilz.hilz@gmail.com
Guest
Posts: n/a
 
      4th Oct 2005

Bucky wrote:
> hilz wrote:
> > I have a csv file with fields that look like this
> > ,"20-10",
> > this is being interpreted as a date when i open it in Excel.

>
> Hmm, that's strange, Excel kept it as text when I opened a test file. I
> have 2003, what version are you using?



I have 2004 as well.
Maybe your locale is not US, and thus, 20-10 is not really a date!
try with:
"1-1","2-2","3-3"

if i save this line in a csv file and open it, i see

1-Jan 2-Feb 3-Mar


Any suggestions?

 
Reply With Quote
 
hilz.hilz@gmail.com
Guest
Posts: n/a
 
      4th Oct 2005
I meant 2003 not 2004!

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      4th Oct 2005
If you rename the .csv to .txt, you'll see the data import wizard open when you
do File|Open.

You can specify that the input file is delimited by commas. Then specify text
for this field.

(In my simple test, when I specified comma delimited, excel "ate" up those
double quotes. If that doesn't happen for you, you could tell excel that it's
delimited by both comma and other (use a double quote) and then still specify
Text for that field.)

If you need to do this lots, you could record a macro that does this same
thing. But you'll still need to change from .csv to .txt.

hilz wrote:
>
> Hi
> I have a csv file with fields that look like this
>
> ,"20-10",
>
> this is being interpreted as a date when i open it in Excel.
> what do i need to do with this filed in order to make Excel consider it
> a text?
> I tried replacing the double quotes with a single quote like this:
>
> ,'20-10',
>
> but that makes the single quote appear in the cell in Excel, which is
> not what i want.
>
> please help.
> thanks


--

Dave Peterson
 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      4th Oct 2005
ps. For me, xl2003 with USA settings, excel didn't see 20-10 as a date.

hilz wrote:
>
> Hi
> I have a csv file with fields that look like this
>
> ,"20-10",
>
> this is being interpreted as a date when i open it in Excel.
> what do i need to do with this filed in order to make Excel consider it
> a text?
> I tried replacing the double quotes with a single quote like this:
>
> ,'20-10',
>
> but that makes the single quote appear in the cell in Excel, which is
> not what i want.
>
> please help.
> thanks


--

Dave Peterson
 
Reply With Quote
 
Bucky
Guest
Posts: n/a
 
      4th Oct 2005
hilz wrote:
> I have a csv file with fields that look like this
> ,"20-10",
> this is being interpreted as a date when i open it in Excel.


,="20-10",

 
Reply With Quote
 
Bucky
Guest
Posts: n/a
 
      4th Oct 2005
(E-Mail Removed) wrote:
> Maybe your locale is not US, and thus, 20-10 is not really a date!


You're right, I'm in the US, so 20-10 is not a date. If I try 10-20,
then it did convert to a date. See my other post for the solution.

 
Reply With Quote
 
hilz.hilz@gmail.com
Guest
Posts: n/a
 
      4th Oct 2005
U Da Man Bucky.... you got it!
thank you so very much....

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dates converted into text rjagathe Microsoft Excel Programming 5 6th Mar 2010 09:30 PM
Pasted fractions converted to dates Jon_C Microsoft Excel Discussion 6 12th Oct 2007 02:49 PM
Can checkboxes used for dates be converted? epete367@optonline.net Microsoft Access Reports 0 26th Oct 2005 01:01 AM
numbers are converted into dates =?Utf-8?B?dmI=?= Microsoft Excel New Users 2 14th Sep 2004 05:42 AM
dates being converted to serial problems Scott Microsoft Excel Worksheet Functions 3 13th Aug 2004 08:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:17 PM.